I want to store an xgboost
model to an sql database and read it back:
I pickled my model and wrote it into a varchar field in my db:
obj = pickle.dumps(mymodel)
#write obj to db in a varchar fieldWhen I read the string back from the database into obj and want to
pickle.loads(obj[0])
, I get this error:TypeError: a bytes-like object is required, not a 'str'
How can I unpickle the string (obj) from my database?