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

please help in solving this error #28

Open
ruchika61 opened this issue Jun 12, 2019 · 2 comments
Open

please help in solving this error #28

ruchika61 opened this issue Jun 12, 2019 · 2 comments

Comments

@ruchika61
Copy link

File "C:/Users/PC5/Downloads/Compressed/JPG-PNG-to-MNIST-NN-Format-master/JPG-PNG-to-MNIST-NN-Format-master/convert-images-to-mnist-format.py", line 25, in
label = int(filename.split('/')[2])

IndexError: list index out of range

@opoooo
Copy link

opoooo commented Aug 14, 2019

Since the machine accepts that the file name is splited by '\', your filename will be stored as "./training-images\1\im51563.png". So filename.split('/') will be ['.', 'training-images\1\im39485.png'], this will lead 'list index out of range'.

You can change line 7 into

Names = [['.\\training-images','train'], ['.\\test-images','t10k']]

and change "label = int(filename.split('/')[2])" into

label = int(filename.split('\\')[2])

@MagnificentCreature
Copy link

File "C:/Users/seanw/.spyder-py3/temp.py", line 42, in
label = int(filename.split('\')[2])

ValueError: invalid literal for int() with base 10: 'im56908.png'

Hi thanks for the suggestion of the changes, but now I get this issue

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

3 participants