Skip to content
Snippets Groups Projects
Commit 49087cb0 authored by Cart Milan's avatar Cart Milan
Browse files

Update read_cifar.py

parent 23a77bd5
Branches
No related tags found
No related merge requests found
import numpy as np
print("Test")
\ No newline at end of file
import pickle
def read_cifar_batch(batch_path):
with open(batch_path, "rb") as f:
batch = pickle.load(f, encoding="bytes")
data = np.array(batch[b'data'], dtype=np.float32)
labels = np.array(batch[b'labels'], dtype=np.int64)
return data, labels
print(read_cifar_batch('Data/cifar-10-batches-py/data_batch_2'))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment