Record one change for Python3

In Python 3, cPickle is replaced by pickle.
This commit is contained in:
an1006634493 2019-03-18 22:09:46 +08:00 committed by GitHub
parent 9a53e1eb86
commit 5bac796ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import cPickle import cPickle
#import pickle #for python 3
import gzip import gzip
import math import math
import numpy as np import numpy as np
@ -156,6 +157,7 @@ def unpickle_cifar_dic(file):
""" """
fo = open(file, 'rb') fo = open(file, 'rb')
dict = cPickle.load(fo) dict = cPickle.load(fo)
#dict = pickle.load(fo) #for python 3
fo.close() fo.close()
return dict['data'], dict['labels'] return dict['data'], dict['labels']