Wiki: Lesson 1

Hi everyone! I have trouble running lesson 1 on my machine because ConvLearner.pretrained consumes too much RAM.
When I set sz=64 instead of sz=224 it’s works well, but the accuracy is lower – about 0.88, because images are smaller now (only 64x64 pixels).
How can I decrease memory consumption without results degradation? I’m fine if model will be trained longer.
I tried to set batch size like this but it’s seems not helping:
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), bs=8)

P. S. I found a solution. If your PC freezes due to the lack of RAM (I am not talking about GPU memory!) you need to specify num_workers=2 or even num_workers=1 in the ImageClassifierData.from_paths function (default is num_workers=8). Batch size only decreases video memory consumption, as far as I understand, which is not a problem in my case.

1 Like