UnicodeDecodeError:'ascii'编解码器无法解码位置8中的字节0xf1:序数不在范围内(128)

时间:2017-11-20 02:21:11

标签: python pickle

以下是我的代码:

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

0 个答案:

没有答案