Reducing the batch size to half, I can run the notebook till the end. BTW: I made a mistake. I reduced the sz variable, the size of images. Not the batch size.
I’m running with 16Gb and a 4Gb GPU as thats best my PSU could handle.
I’m anticipating the odd issue and haven’t finished the course, so you should be ok. I ran a little batch script to tell me what the GPU was doing - useful to make sure its being used appropriately
With 16gb you should be able to run any lesson nb without trouble. Generally speaking, it is recommended to have at least twice the video memory amount. For example, I have 16gb of ram and 8gb of vram. This is, however, just a rule of thumb.
Note that, for example, if you have an ultra-fast nvme drive and swap space properly configured, the need for more RAM will be less urgent. Furthermore, as you discovered, memory problems could be alleviated by reducing batch sizes.
You didn’t share the error, but this generally would be indicative of there not being enough RAM on the GPU.
You can verify this by running from terminal (before you run the notebook):
nvidia-smi -l
If you see your GPU memory gets filled up, you will know what is happening In such a case I am afraid your only option would be replacing the GPU. But if you have a GTX1060, I would be comfortable using it for the whole part 1 of the course. Only then if you want to pursue this further might be a good time to invest in something with more RAM.*
EDIT: * I am only saying this as whether you reduce the batch size or not should not have any impact on your learning in the course But by all means if you feel like adding RAM / replacing the GPU and find it affordable go for it! 1080TI seems to be a popular choice. But if your goal is to run the notebooks unmodified definitely check where the bottleneck is My money is on the GPU.
I created a .bat - rather than it running all the time from before opening jupyter notebook, I can start/stop as wanted.
I switched to the following line, which updates every 5 seconds and gives loads of info nvidia-smi dmon -d 5
Just to pitch in, I tried using a machine with 8GB RAM and it could not complete the first course. All the memory would be consumed when trying to train on the dogs/cats exercise.
System -> Advanced system settings, then follow what you see in the screencaps below.
Once Virtual Memory panel opens, be sure the swap file is on a drive with at least 30-40Gb free, or even better, set it manually at 32gb if you can afford it.
That holds if you have a ssd. If you have a spinning disk, you are bottlenecked and the only viable option is a ram upgrade.