ptrblck - isn’t the default for requires_grad is “True”? (so that even after I delete this part, the variable would still be True?)
After removing the “requires_grad = True”, and with a batch size of “1”, the code runs with a GPU memory usage of 3.4 GB. Increasing the batch size to “2” results in an “out of memory” error in the second iteration…  Is it possible that 4GB of RAM are not enough for a batch size of “2” in this case? (as mentioned in a previous comment - it is the ants and bees dataset from the transfer learning tutorial)
Looking forward for your answer. Thanks a lot!