Open Git-yangzai opened 4 years ago
When I train the model with datasets. No matter how small the batch_size and img-resolution I set ,error always raise like:
RuntimeError: CUDA out of memory. Tried to allocate 1.73 GiB (GPU 0; 4.00 GiB total capacity; 1.04 GiB already allocated; 1.97 GiB free; 6.95 MiB cached)
and this site may help. It says I should use
with torch.no_grad:
orinputs = Variable(inputs, volatile=True)
in validation_step. Could u tell where exactly I should place these codes plz? THX A LOT!
I am not sure what you have done to set the batch_size.
I want to remind you that the batch=32
in yolo*.cfg
isn't the actual batch_size.
You need to set batch_size through the command line arguments, referring to train.py
.
Good luck.
@Git-yangzai did you solve the problem? I am training in colab and i got the same error. i tried to reduce the batch_size = 16 and then 8. but it didn't work for me.
When I train the model with datasets. No matter how small the batch_size and img-resolution I set ,error always raise like:
and this site may help. It says I should use
with torch.no_grad:
orinputs = Variable(inputs, volatile=True)
in validation_step. Could u tell where exactly I should place these codes plz? THX A LOT!