You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use anaconda3 as my base python environment. However, the error that _pickle.UnpicklingError: the STRING opcode argument must be quoted always came out whenever I tried with python3 + open('adj_mx.pkl', 'rb') or python3 + open('adj_mx.pkl', 'r') in the interative shell.
Then I tried with python2 + open('adj_mx.pkl', 'rb'), and it came out with the error raise ValueError, "insecure string pickle".
Finally, it worked with python2 + open('adj_mx.pkl', 'r'). However, it is inconsistent with code gen_adj_mx.py, and utils.load_pickle. It confused me for quite a few days.
Solution
Python 2.7.15
>>> import numpy as np
>>> import pickle
>>> f = open('adj_mx.pkl', 'r')
>>> data = pickle.load(f)
>>> with open('adj_mx_new.pkl', 'wb') as f:
>>> pickle.dump(data, f, protocol=2)
You can replace the newly generated adj_mx_new.pkl with adj_mx.pkl. Then, it works python run_demo.py --config_filename=data/model/pretrained/METR-LA/config.yaml both under Python2 and Python3.
The text was updated successfully, but these errors were encountered:
_pickle.UnpicklingError: the STRING opcode argument must be quoted
always came out whenever I tried withpython3 + open('adj_mx.pkl', 'rb')
orpython3 + open('adj_mx.pkl', 'r')
in the interative shell.python2 + open('adj_mx.pkl', 'rb')
, and it came out with the errorraise ValueError, "insecure string pickle"
.python2 + open('adj_mx.pkl', 'r')
. However, it is inconsistent with code gen_adj_mx.py, and utils.load_pickle. It confused me for quite a few days.Solution
You can replace the newly generated adj_mx_new.pkl with adj_mx.pkl. Then, it works
python run_demo.py --config_filename=data/model/pretrained/METR-LA/config.yaml
both under Python2 and Python3.The text was updated successfully, but these errors were encountered: