我在使用pickle加载pkl文件时遇到了一些问题.我正在使用
Windows 7和
Python 3.5.1 64位. pkl文件是从
here下载的.
这是我的代码:
import pickle # Load model weights and Metadata weightFile = open('vgg16.pkl','rb') d = pickle.load(weightFile)
当我运行它时,我得到了输出
"C:\Program Files\Python35\python.exe" C:/work/lasagne/tutorial/lasagne-tutorial2.py Traceback (most recent call last): File "C:/work/lasagne/tutorial/lasagne-tutorial2.py",line 5,in <module> d = pickle.load(weightFile) UnicodeDecodeError: 'ascii' codec can't decode byte 0xbc in position 1: ordinal not in range(128) Process finished with exit code 1
这个错误信息是什么意思?它说有一个字节,acsii编解码器无法解码,但不是pkl文件应该是二进制(因此不包含ascii字符)?