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' unpickle rb... maybe that's problem...
  • the other thing found out: 0x86 can decoded using latin-1. maybe can try change this, or both.

i read in pickle docs pickle protocoll automatically detected , should not cause problem. seems encoding...


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -