HHTseng / video-classification

Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
936 stars 216 forks source link

ResNetCRNN #9

Closed raghavgarg97-zz closed 5 years ago

raghavgarg97-zz commented 5 years ago

In your ResNetCRNN/ResNetCRNN_check_prediction.py, you have missed " if torch.cuda.device_count()>1: ..............=nn.DataParallel(.....) " Due to which Multiple GPU trained models could not be loaded here as their conf. files have weights in thee form module.fc3.bias ...etc. and not fc3.bias

HHTseng commented 5 years ago

For a quick reply: I noticed it matters when you use how many GPU to train and to reload. In Pytorch, it seems that pretained models trained on single GPU cannot be reloaded with multiple GPUs. And sorry that I didn't mention the pretrained weight given here were trained on single GPU. I will add pretrained model of multiple GPUs later. But for now, you may simply use the following to block your other CUDA devices:

import os
os.environ["CUDA_DEVICE_ORDER"]= "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]= "0"

please let me know if this solve the reload problem temporarily.

raghavgarg97-zz commented 5 years ago

yes It solved the problem.Actually I trained my own model on multiple GPUs and thus they were not loading.Though packing them with nn.DataParallel class also solved the problem

HHTseng commented 5 years ago

That's nice. I will still provide two kinds of pretrained models later for single GPU and multiple GPUs.