We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` fo = open(path, 'rb') dicts = pickle.load(fo) fo.close()
data = dicts['data'] if is_random_label is False: label = np.array(dicts[b'labels']) else: labels = np.random.randint(low=0, high=10, size=10000) label = np.array(labels) return data, label`
2.当修改成dicts = pickle.load(fo,encoding='bytes')程序可以继续运行,但是在data = dicts['data']报错:KeyError: 'data'。当我查看dicts.key()后,我发现结果是:dict_keys([b'data', b'labels', b'batch_label', b'filenames']),为什么每个键的前面会出现字母b?
The text was updated successfully, but these errors were encountered:
you can modify it to pickle.load(fo,encoding='iso-8859-1')
Sorry, something went wrong.
No branches or pull requests
` fo = open(path, 'rb')
dicts = pickle.load(fo)
fo.close()
data = dicts['data']
if is_random_label is False:
label = np.array(dicts[b'labels'])
else:
labels = np.random.randint(low=0, high=10, size=10000)
label = np.array(labels)
return data, label`
2.当修改成dicts = pickle.load(fo,encoding='bytes')程序可以继续运行,但是在data = dicts['data']报错:KeyError: 'data'。当我查看dicts.key()后,我发现结果是:dict_keys([b'data', b'labels', b'batch_label', b'filenames']),为什么每个键的前面会出现字母b?
The text was updated successfully, but these errors were encountered: