TCMR_RELEASE
TCMR_RELEASE copied to clipboard
how to run demo on CPU
I wanted to run demo on CPU so I tried
python demo.py --vid_file demo.mp4 --gpu -1
However, it turned out:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
Then I tried to fix code in demo.py in line 108 and line 127. But it still couldn't work.
Did you also change the code here?
Did you also change the code here? It works, thanks!
i did the same thing and i changed the code as follow:
demo.py {
line 108: ckpt = torch.load(pretrained_file,map_location=torch.device('cpu'))
line 127: checkpoint = torch.load(osp.join(BASE_DATA_DIR, 'spin_model_checkpoint.pth.tar'),map_location=torch.device('cpu'))
}
tcmr.py {
line 134: pretrained_dict = torch.load(pretrained,map_location=torch.device('cpu'))['model']
}
but I'm still getting this error:
AssertionError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
@hongsukchoi
thank you for your answer but i still have the same error even after eliminating that line (line 374 in demo.py)
can i run it in google colab ?
No, I haven't prepared google colab codes.
I recommend you follow this instructions to run on CPU. I did the same thing and was able to run TCMR on CPU. In demo.py
L55 : device = torch.device('cpu')
L108: ckpt = torch.load(pretrained_file,map_location=torch.device('cpu'))
L115: model.regressor.smpl = SMPL(
SMPL_MODEL_DIR,
batch_size=64,
create_transl=False,
gender=gender
) #.cuda()
L127: checkpoint = torch.load(osp.join(BASE_DATA_DIR, 'spin_model_checkpoint.pth.tar'),map_location=torch.device('cpu'))
In tcmr.py
L134: pretrained_dict = torch.load(pretrained, map_location=torch.device('cpu'))['model']