gskielian / JPG-PNG-to-MNIST-NN-Format

Python/Bash scripts for creating custom Neural Net Training Data -- this repo is for the MNIST format
Apache License 2.0
215 stars 127 forks source link

question about array typecode of data_image #16

Open xiaozhaolhg opened 6 years ago

xiaozhaolhg commented 6 years ago

Hello, I ran into a problem when running JPG-PNG-to-MNIST-NN-Format/convert-images-to-mnist-format.py:

Traceback (most recent call last): File "/Users/shhgliu/git/JPG-PNG-to-MNIST-NN-Format/convert-images-to-mnist-format.py", line 35, in data_image.append(pixel[y,x]) TypeError: an integer is required

after checking the code, I find the root cause is the typecode of data_image is 'B', which mean it only contains integer, however, at line 35, data_image.append(pixel[y,x]), the expression "pixel[y,x]" returns an array object.

so could you please help to check it? thanks!

ArtemGuy commented 6 years ago

Your images in grayscale or not?