benbogin/obverter

Possible bug during image loading

Opened this issue · 3 comments

There seems to be a subtle bug in converting images to ndarrays here

obverter/data.py

Lines 30 to 31 in 28cf878

images_cache[color, object_type, i] = np.array(
list(Image.open(path).getdata())).reshape((128, 128, 3))

I believe it swaps some dimensions in the array and produces noisy images, e.g.
https://i.imgur.com/HDu78dD.png

Obviously, the model fails to train (remains at 0.75 accuracy).

Interesting! When I ran it I didn't encounter such a problem, and the model trained successfully.
Perhaps it's a matter of packages versions/os type/etc, which defines the order of the dimensions.

Strange indeed. I'm running on macOS 10.14 with Python 3.6.1, Pillow==6.1.0 and numpy==1.16.4. Also, I untarred assets/dataset.tar.gz; didn't create the dataset from scratch. I'll try to investigate this.

PS. Really loved the CCO paper, though.

the images look ok on a mac for me. I wonder if your accuracy issue is because you are using a recent version of torch? I had to downgrade to 0.4.1, and then worked ok for me (I only tested on linux, but on linux, with a recent torch version, I was getting acc=0.75), see #4