Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: total size of new array must be unchanged error #22

Open
mnomanmemon opened this issue Mar 20, 2016 · 1 comment
Open

ValueError: total size of new array must be unchanged error #22

mnomanmemon opened this issue Mar 20, 2016 · 1 comment

Comments

@mnomanmemon
Copy link

The code from the load.py is generating error of "total size of new array must be unchanged". It just loads the mnist dataset to an array and then reshaping it. The error occurs while reshaping it (in 3rd line) and it is shown below:

 fd = open('C:\\Users\\***\\Desktop\\MNIST Dataset\\train-images.idx3-ubyte.gz')
 loaded = np.fromfile(file=fd,dtype=np.uint8)

---> trX = loaded[16:].reshape((60000,28*28)).astype(float)

 ValueError: total size of new array must be unchanged

I know what the function of reshape is doing. I just didn't figure it out that how to resolve this error. I have tried many things but didn't work in my favour. Can anyone suggest me any solution?

@dbparedes
Copy link

I can see that you have MNIST dataset as .gz files. You have to unzip those files manually and you will see that the filenames are the same as the original ones on the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants