Update input.py
This commit is contained in:
parent
5bac796ee6
commit
d139d94f32
1 changed files with 5 additions and 4 deletions
|
@ -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']
|
||||
|
||||
|
|
Loading…
Reference in a new issue