Show_batch() displaying weird colored images

I am running the notebooks in VSCode and wonder why the images are so weirdly colored when displayed by executing “show_batch()”. Can anybody perhaps tell why?

output

Facing the same issue!

Possible issue: the dataloader returns normalized values, and show_batch displays the normalized images itself, which cause these weird image displays, as a result of clipping.
Will look into this issue deeper later today.

Could be. But what I don’t understand is why it’s different on kaggle than VSCode.

Havent used Kaggle yet. Whats the fastai version on kaggle?

Oh right, forgot to take that into account.
It’s 2.5.3 on kaggle and 2.7.6 (latest) on local.

Got it, let me compare the code across these 2 versions and pin point the error.

Thanks for the update
Palaash!

1 Like

I’m observing this issue as well. It happens only on Mac. It seems to be related to the recent changes added for ‘mps’ support.

If I disable mps support by commenting out this line, in fastai/torch_core.py, then everything works fine.

if _has_mps(): return torch.device('mps')

Investigating further, this seems to be an issue on the pytorch side. I installed the latest pytorch nightly (torch 1.13.0.dev20220729) and the issue is not present. Images are displayed correctly with mps device enabled.

2 Likes