Skip to content

Instantly share code, notes, and snippets.

@joeyism
Last active June 25, 2018 18:38
Show Gist options
  • Save joeyism/7b6158b12400f589f53b309a74322294 to your computer and use it in GitHub Desktop.
Save joeyism/7b6158b12400f589f53b309a74322294 to your computer and use it in GitHub Desktop.
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