Why not use multiple gpu?
ciwei123 opened this issue · 3 comments
@lidq92 ,Hi, thanks for your sharing,and I found that the code is running on a single gpu ,why not run on multiple GPUs? I can successfully run the CNNfeature.py on a single gpu,but when I use multiprocessing , I meet the error:
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=50 error=3 : initialization error
Process Process-8:
Traceback (most recent call last):
File "/root/anaconda3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/root/anaconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/MDTVSFA-main/CNNfeatures_mp.py", line 147, in run
features = get_features(current_data['video'], frame_batch_size, model, device)
File "/MDTVSFA-main/CNNfeatures_mp.py", line 121, in get_features
output1 = torch.Tensor().to(device)
File "/root/anaconda3/lib/python3.6/site-packages/torch/cuda/init.py", line 193, in _lazy_init
torch._C._cuda_init()
RuntimeError: cuda runtime error (3) : initialization error at /pytorch/aten/src/THC/THCGeneral.cpp:50
@ciwei123 You can simply use nn.DataParallel
with multiple GPUs to enlarge the true batch size.
And you can refer to lines 587-590 in lidq92/WaDIQaM/main.py for a simple illustration.
Running on a single GPU is just OK for people who use only one GPU.
If the GPU memory is not enough, one can even set frame_batch_size=1
.
@lidq92 Thanks for your reply . And there is another question. I can not open the "FORM" needed to download the dataset. Could you share LIVE-Qualcomm dataset according to Baidudisk. Thank you very much!
@ciwei123 See lidq92/VSFA#18 (comment) and lidq92/VSFA#30 (comment)
@lidq92 Thanks for your reply . And there is another question. I can not open the "FORM" needed to download the dataset. Could you share LIVE-Qualcomm dataset according to Baidudisk. Thank you very much!