Vision Transfomer issue with broadcasting shapes
Hello,I am using image transformers from HF but although my images are RGB, I keep getting the following error:operands could not be broadcast together with shapes (224,224) (3,) (224,224) .Any idea on how I can dynamically fix this? Should I do this using collate?
2022-11-23T08:00:18Z
Hi,Could you provide a code snippet to reproduce your error?You’re sure that you did image.convert(“RGB”)?
2022-11-23T14:12:06Z
I added the following portion:data = load_dataset(“venetis/VMMRdb_make_model”)def transforms(examples):examples[“image”] = [image.convert(“RGB”) for image in examples[“image”]]data = data.map(transforms,batched=True)and it seems to produce the following error:UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f0b3a27dd70>
2024-04-24T19:44:37Z
Same problem.
2024-04-29T10:02:21Z
anon76594689:UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f0b3a27dd70>I usually get this error when the image is not an appropriate file.