-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
I used numpy.fromfile api to read given data, but got wrong data. code are as follow:
import numpy as np
a = np.fromfile('data/train-images-idx3-ubyte', dtype=np.float32)
b = np.fromfile('data/train-labels-idx1-ubyte', dtype=np.uint8)
l_a = a.shape[0]
l_b = b.shape[0]
print(f"{l_a // (28*28)} images found")
print(f"{l_b} labels found")
and the output is this:
15000 images found
60008 labels found
It seems not all right. What's wrong with this solution and what can I do to run it properly?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels