Introduction to Diffusers Notebook - Mac M1 Support
I have spotted an Issue not directly for this notebook but for Mac m1 users.
If you set device = torch.device("cpu") the output of show_images(xb).resize((8 * 64, 64), resample=Image.NEAREST) gives you 8 different images of butterflies.
Bit if you set device = torch.device("mps") the output of the same functions return 8 times the same butterfly.
Don´t know what's going on under the hood with torch gpu for Mac m1 yet - didn't find something googeling it.
Very strange! Hopefully someone with a mac can figure out a fix, I can't think what would be causing this.
I can repo this but I think the issue in pytorch core from this issue I found:
https://github.com/pytorch/pytorch/issues/84523
The simple workaround as far as this notebook goes looks like moving the detach().cpu() operation into make_grid.
grid = torchvision.utils.make_grid(x.detach().cpu())
grid_im = grid.permute(1, 2, 0).clip(0, 1) * 255
Thanks for the detective work @angellmethod, I'll test and push the change post Christmas chaos :)