filename = "/content/classifier_10class.pkl"
infile = open(filename,'rb')
new_dict = pickle.load(infile)
infile.close()
EOFError Traceback (most recent call last)
<ipython-input-57-36f3a6bd7cfb> in <module>()
1 filename = "/content/classifier_10class.pkl"
2 infile = open(filename,'rb')
---> 3 new_dict = pickle.load(infile)
4 infile.close()
EOFError: Ran out of input
可以试试下面的代码吗?
>>> import pickle
>>> with open('file.pkl', 'rb') as fp:
>>> data = pickle.load(fp)