Reputation: 15
I'm trying to load the mnist digit dataset and am routinely getting this error. I'm unable to find any solutions online
This code:
from mnist import MNIST
m = MNIST(path)
x_train, y_train = m.load_training()
Yields this error:
File "<stdin>", line 1, in <module>
File "C:\Python38\lib\site-packages\mnist\loader.py", line 125, in load_training
ims, labels = self.load(os.path.join(self.path, self.train_img_fname),
File "C:\Python38\lib\site-packages\mnist\loader.py", line 250, in load
raise ValueError('Magic number mismatch, expected 2049,'
ValueError: Magic number mismatch, expected 2049,got 529205256
I'm running python-mnist 0.7.
Upvotes: 1
Views: 1123
Reputation: 19
I've just had the exact same error and I fixed it by renaming the files:
If you rename the files like that it should work, at least that's what worked for me.
Upvotes: 1