How to unpickle a model in python 3X which is pickled in python 2.7? -
i have pickled model in python 2.7 following sentence
import pickle open('filename','w') f: pickle.dump(model, f) how in python 3.x , unpickle model, error
'utf-8' codec can't decode byte 0x86 in position 4: invalid start byte the code tried is:
import pickle open('filename','rb') f: model = pickle.load(f, encoding='utf-8')
- you pickle
'w'unpicklerb... maybe that's problem... - the other thing found out:
0x86can decoded usinglatin-1. maybe can try change this, or both.
i read in pickle docs pickle protocoll automatically detected , should not cause problem. seems encoding...
Comments
Post a Comment