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
IndexError: list index out of range #13
Comments
|
@ijbo thank you very much. Can you explain your solution, please. I am new in pyton. |
When I using this, it is giving me a syntax error:
I am not able to understand what's the problem. Please, help me. |
There's a misunderstanding @ShalluSharma. What @ijbo meant was to replace the Actually, it should not be necessary to use |
I am getting an error in this line of the code as follows:
label = int(filename.split('/')[2])
IndexError: list index out of range
So i tried changing it as follows:
label = (filename.split("\")[2])
label1 = int(label)
Im = Image.open(filename)
pixel = Im.load()
width, height = Im.size
for x in range(0, width):
for y in range(0, height):
data_image.append(pixel[y, x])
and i again got error as:
label1 = int(label)
ValueError: invalid literal for int() with base 10: 'im9085.png'
I am using this script on the data given here itself.
How should i solve this error and get all the 4 files required?
The text was updated successfully, but these errors were encountered: