Cannot load MNIST data with the python-mnist package on Windows

541 views python

I installed the python-mnist package via pip on my Windows device, just as described in the Github documentation, by entering the following command in my Anaconda terminal:

pip install python-mnist

This worked fine for me. However, when I am trying to load the data with this package like this :

import mnist
train_images = mnist.train_images()

I get the following error

AttributeError: module 'mnist' has no attribute 'train_images'

I am pretty new to installing packages in python and I am quite clueless as to why this is happening. I have been looking for other attributes that 'mnist' has and found that by going to mnist.MNIST I found a module that is called "train_images". However, changing the code to

import mnist

still gives the same error. I would appreciate any help on how to fix this error.

answered question

1 Answer


You have to define a path of "mnist"

posted this

Have an answer?


Please login first before posting an answer.