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 division
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import cPickle
|
try:
|
||||||
#import pickle #for python 3
|
import cPickle as pickle
|
||||||
|
except:
|
||||||
|
import pickle
|
||||||
import gzip
|
import gzip
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -156,8 +158,7 @@ def unpickle_cifar_dic(file):
|
||||||
:return: tuple of (images, labels)
|
:return: tuple of (images, labels)
|
||||||
"""
|
"""
|
||||||
fo = open(file, 'rb')
|
fo = open(file, 'rb')
|
||||||
dict = cPickle.load(fo)
|
dict = pickle.load(fo)
|
||||||
#dict = pickle.load(fo) #for python 3
|
|
||||||
fo.close()
|
fo.close()
|
||||||
return dict['data'], dict['labels']
|
return dict['data'], dict['labels']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue