Thanks @Jason,
After more testing, I realized the error might be related to the fact that I’m using a Mac computer with M1 chip ( It is strange though it happens after a few iterations and not immediately). I tested it on a different apple machine (Quad-Core Intel Core i7) and it did not show up.
You can find the sample code here: Glitch :･ﾟ✧ 2 . The bug shows up when you click on the “Train Without Cropping” button.
It would be great if someone out there with an M1 chip could confirm.
Regards,
a.