我正在尝试从斯坦福网站加载 Pascal VOC 数据集。还尝试在 Pascal VOC Pystruct 博客上实现语义图像分割的代码。但是当我尝试加载泡菜文件时,我得到了 UnicodeDecodeError。到目前为止,我尝试了以下代码:
import numpy as np
try:
import cPickle as pickle
except ImportError:
import pickle
from pystruct import learners
import pystruct.models as crfs
from pystruct.utils import SaveLogger
data_train = pickle.load(open("trainingData/data_train.pickle"))
C = 0.01
我得到了这个错误:
Traceback (most recent call last):
File "/Users/mypath/PycharmProjects/semantic_segmentation_ex/ex1.py", line 11, in <module>
data_train = pickle.load(open("trainingData/data_train.pickle"))
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
我找不到任何相同的问题和解决方案。我怎样才能让它工作?