以下是我的代码:
import gzip
import _pickle as cPickle
filename = "C:\\Users\\tende\\Desktop\\NLP\\hw2_package\\atis.small.pkl.gz"
f = gzip.open(filename,'rb')
train_set, valid_set, test_set, dicts = cPickle.load(f)
我收到此错误:
import gzip
import _pickle as cPickle
filename = "C:\\Users\\tende\\Desktop\\NLP\\hw2_package\\atis.small.pkl.gz"
f = gzip.open(filename,'rb')
train_set, valid_set, test_set, dicts = cPickle.load(f)
Traceback (most recent call last):
File "<ipython-input-27-aecb21b3784f>", line 6, in <module>
train_set, valid_set, test_set, dicts = cPickle.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf1 in position 8: ordinal not in range(128)
请告诉我哪里出错了。我使用的是Python 3.6.2