why "RuntimeError CUDA out of memory" in testing?
The same model ran fine for training with batch-size=5. I reduced the batch size from 80 to 5 during training because of the same error. I am using a GPU with 11GB of memory instead of Titan X (12GB memory), the one used by the author in actual experiment.  

However, now in testing, which only has batch-size=1, it is not running. 

The issue is in I-frame model testing phase, the other two models have successfully produced results for testing.

Following is my testing command: 

time python test.py --arch resnet152 --data-name ucf101 --representation iframe --data-root data/ucf101/mpeg4_videos --test-list data/datalists/ucf101_split1_test.txt --weights ucf101_iframe_model_iframe_model_best.pth.tar --save-scores iframe_score_file


I have used nvidia-smi to make sure nothing else is running on the GPU. 

Following is the actual error message: 

RuntimeError: CUDA out of memory. Tried to allocate 384.00 MiB (GPU 0; 10.92 GiB total capacity; 10.12 GiB already allocated; 245.50 MiB free; 21.69 MiB cached)


What could be the issue and how it can be fixed?

EDIT: By removing the following two lines from test.py, it starts running without an memeory issue, but it is taking ages to process: 

net = torch.nn.DataParallel(net.cuda(devices[0]), device_ids=devices)
net.eval() 


Yes, the above lines are for GPU based parallel processing.  

Still, is there a solution to my problem?

I have run this model/testing on GPU with memory upto 8GB, by adding the following flag in the testing command given in the question:  

--test-crops 1

