rename var

This commit is contained in:
Nicolas Papernot 2019-03-18 09:27:57 -07:00 committed by GitHub
parent 38ae6ce3b3
commit ec2204ac97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,10 +127,10 @@ def extract_svhn(local_url):
with tf.gfile.Open(local_url, mode='r') as file_obj:
# Load MATLAB matrix using scipy IO
dict = loadmat(file_obj)
data_dict = loadmat(file_obj)
# Extract each dictionary (one for data, one for labels)
data, labels = dict["X"], dict["y"]
data, labels = data_dict["X"], data_dict["y"]
# Set np type
data = np.asarray(data, dtype=np.float32)
@ -155,9 +155,9 @@ def unpickle_cifar_dic(file):
:return: tuple of (images, labels)
"""
fo = open(file, 'rb')
dict = pickle.load(fo)
data_dict = pickle.load(fo)
fo.close()
return dict['data'], dict['labels']
return data_dict['data'], data_dict['labels']
def extract_cifar10(local_url, data_dir):