You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I run the train.py,I get the following error
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
Traceback (most recent call last):
File "/home/snow/Documents/study/ufldl_tutorial/train.py", line 42, in
images = load_MNIST.load_MNIST_images('data/mnist/train-images-idx3-ubyte')
File "/home/snow/Documents/study/ufldl_tutorial/load_MNIST.py", line 20, in load_MNIST_images
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
ValueError: cannot reshape array of size 9912406 into shape (2055376946,1902539786)
#####code begin
with open(filename, "rb") as f:
magic = np.fromfile(f, dtype=np.dtype('>i4'), count=1)
I google the http://yann.lecun.com/exdb/mnist/
find the value:
0004 32 bit integer 60000 number of images
0008 32 bit integer 28 number of rows
0012 32 bit integer 28 number of columns
by calculating the value, I find 282860000 larger than the 9912422,that makes me so confused,
How can I correct the code?
The text was updated successfully, but these errors were encountered:
It's easy to solve, when you download these file(.gz), you must decompressed they at first.
I meet the error, for these words in the http://yann.lecun.com/exdb/mnist/
please note that your browser may uncompress these files without telling you. If the files you downloaded have a larger size than the above, they have been uncompressed by your browser. Simply rename them to remove the .gz extension.
when I run the train.py,I get the following error
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
Traceback (most recent call last):
File "/home/snow/Documents/study/ufldl_tutorial/train.py", line 42, in
images = load_MNIST.load_MNIST_images('data/mnist/train-images-idx3-ubyte')
File "/home/snow/Documents/study/ufldl_tutorial/load_MNIST.py", line 20, in load_MNIST_images
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
ValueError: cannot reshape array of size 9912406 into shape (2055376946,1902539786)
#####code begin
with open(filename, "rb") as f:
magic = np.fromfile(f, dtype=np.dtype('>i4'), count=1)
#####code end
I google the http://yann.lecun.com/exdb/mnist/
find the value:
0004 32 bit integer 60000 number of images
0008 32 bit integer 28 number of rows
0012 32 bit integer 28 number of columns
by calculating the value, I find 282860000 larger than the 9912422,that makes me so confused,
How can I correct the code?
The text was updated successfully, but these errors were encountered: