Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading pickle file #32

Open
bml1g12 opened this issue Oct 15, 2018 · 1 comment
Open

Error loading pickle file #32

bml1g12 opened this issue Oct 15, 2018 · 1 comment

Comments

@bml1g12
Copy link

bml1g12 commented Oct 15, 2018

Running python 2.7 on ubuntu, running the first notebook RunParts.ipynb I get an error:

Running
parts_predictor.run_inference(bg_pretrained = True,regression_pretrained = True,verbose = True)

/DeepOcclusion/VGG/VGGNet.py

paramsValuesVGG = pickle.load(open(os.path.dirname(__file__)+"/models/paramsVGG.pickle","rb"))

Throws the error:
ValueError: insecure string pickle

Loading the pickle load on that file using instead my Python 3.6 environment gives:

>>> pickle.load(open("/home/ben/software/DeepOcclusion/VGG/models/paramsVGG.pickle","rb"))                                                                                                                                                                    
Traceback (most recent call last):                                                                                                                                                                                                                                             
  File "<stdin>", line 1, in <module>                                                                                                                                                                                                                                          
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)       

And if I change encoding to latin1/bytes gives:

pickle.load(open("/home/ben/software/DeepOcclusion/VGG/models/paramsVGG.pickle","rb"))
Traceback (most recent call last):
File "", line 1, in
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

Which has already been reported and closed in #9 but I am unsure what the solution was.

@luochonghai
Copy link

Well, in python 3.6, I just modify my code as: pickle.load(open("/home/ben/software/DeepOcclusion/VGG/models/paramsVGG.pickle","rb"),encoding = 'bytes') and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants