Skip to content

Bug during ScreamDSprites initialization #34

@bonheml

Description

@bonheml

I have noticed a bug when trying to use ScreamDsprites:

from disentanglement_lib.data.ground_truth.dsprites import ScreamDSprites
ScreamDSprites([1,2,3,4,5])

Raises an error:
Traceback (most recent call last): File "<input>", line 1, in <module> File "disentanglement_lib/disentanglement_lib/data/ground_truth/dsprites.py", line 183, in __init__ scream.thumbnail((350, 274, 3)) File ".venv/disentanglement_lib/lib/python3.6/site-packages/PIL/Image.py", line 2299, in thumbnail x, y = map(math.floor, size) ValueError: too many values to unpack (expected 2)

The issue seems to be that thumbnail size is taking a tuple of 3 values instead of 2.
I have modified l.182 of dsprites.py from scream.thumbnail((350, 274, 3)) to scream.thumbnail((350, 274)) and this is working properly.

I am using Pillow 8.0.1, but the thumbnail size was already 2D in Pillow 5.0.0 so this is not a compatibility issue.

I should add that the bug is also present in cars3D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions