Closed tikitong closed 1 year ago
In my case, inference with cpu via the --cpu argument needs the addition of map_location=torch.device('cpu') in torch.load() to succeed. Can you confirm? Many thanks!
--cpu
map_location=torch.device('cpu')
torch.load()
https://github.com/harlanhong/CVPR2022-DaGAN/blob/78b22edcdbb4192b81c5adf343f980b42cddfe5d/demo.py#L166
if opt.cpu: loaded_dict_enc = torch.load('checkpoints/depth_face_model/encoder.pth', map_location=torch.device('cpu')) loaded_dict_dec = torch.load('checkpoints/depth_face_model/depth.pth', map_location=torch.device('cpu'))
Correct. Thanks you.
In my case, inference with cpu via the
--cpu
argument needs the addition ofmap_location=torch.device('cpu')
intorch.load()
to succeed. Can you confirm? Many thanks!https://github.com/harlanhong/CVPR2022-DaGAN/blob/78b22edcdbb4192b81c5adf343f980b42cddfe5d/demo.py#L166