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

TypeError: 'int' object has no attribute '__getitem__' #1

Open
wonny2001 opened this issue Sep 13, 2017 · 2 comments
Open

TypeError: 'int' object has no attribute '__getitem__' #1

wonny2001 opened this issue Sep 13, 2017 · 2 comments

Comments

@wonny2001
Copy link

Traceback (most recent call last):
File "/home/rainman/git/myresnet/cifar10/PNG-2-CIFAR10/convert-images-to-cifar-format.py", line 42, in
data.append(pix[x,y][color])
TypeError: 'int' object has no attribute 'getitem'

@macma
Copy link

macma commented Nov 7, 2017

Don't convert the images to PNG, I just use the original jpg file, that will work

@nubenum
Copy link

nubenum commented Dec 2, 2017

I think the problem occurs if you have some PNGs in grayscale. Using the original JPEGs as @macma suggested might help, I just added PNG24: before the output image in my resize script so that imagemagick enforces a color PNG.

convert "$file" -resize 32x32\! PNG24:"${file%.*}.png"

(havn't tested this particular line, using my own resize script)

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