Last active
June 25, 2018 18:38
-
-
Save joeyism/7b6158b12400f589f53b309a74322294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
def __extract_file__(fname): | |
with open(fname, 'rb') as fo: | |
d = pickle.load(fo, encoding='bytes') | |
return d | |
def __extract_reshape_file__(fname): | |
res = [] | |
d = __extract_file__(fname) | |
images = d[b"data"] | |
labels = d[b"labels"] | |
for image, label in zip(images, labels): | |
res.append((image, label)) | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment