Kernel crash on DataCrunch when applying chapter 4's concept

Hi all,

I’m trying to apply what I learned in chapter 4 of the Deep Learning for Coders book to another dataset, the fruits and vegetables dataset from Kaggle.

However, every single time I run the code cell, the Kernel crashes after maybe 5 minutes …

I doubt that it’s because of the dataset’s size (only 2GB of images). My notebook is hosted on a DataCrunch GPU server: 1 * NVidia Tesla V100 1V100.6V 6CPU 23GB RAM 16GB GPU RAM.

The code is available here, more specifically, the kernel crashes while the following line is being executed (I put lots of print statement everywhere, and the last evaluated was right above this line):

x = [tensor(Image.open(image_path)) for image_path in x]

Anyone has an idea what could cause the kernel to crash? :thinking_face:
Note that I already applied the above code to the MNIST dataset and it worked fine. I just changed the paths to point to the fruits and vegetables dataset instead.