Update input.py

This commit is contained in:
Nicolas Papernot 2019-03-18 07:29:18 -07:00 committed by GitHub
parent 5bac796ee6
commit d139d94f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,10 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cPickle
#import pickle #for python 3
try:
import cPickle as pickle
except:
import pickle
import gzip
import math
import numpy as np
@ -156,8 +158,7 @@ def unpickle_cifar_dic(file):
:return: tuple of (images, labels)
"""
fo = open(file, 'rb')
dict = cPickle.load(fo)
#dict = pickle.load(fo) #for python 3
dict = pickle.load(fo)
fo.close()
return dict['data'], dict['labels']