Closed ShrutiKumari02 closed 4 weeks ago
As suggested
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.
Change
https://github.com/hzxie/Pix2Vox/blob/69e2579f9baab90eac1ec0a24c184d010e9a0fde/core/test.py#L77
to
checkpoint = torch.load(cfg.CONST.WEIGHTS, map_location=torch.device('cpu'))
As suggested
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.
Change
https://github.com/hzxie/Pix2Vox/blob/69e2579f9baab90eac1ec0a24c184d010e9a0fde/core/test.py#L77
to
checkpoint = torch.load(cfg.CONST.WEIGHTS, map_location=torch.device('cpu'))
I made the changes as suggested now I am getting this runtime error.Kindly suggest how can I fix this?
C:\Users\shruti.k\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
C:\Users\shruti.k\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None
for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=VGG16_BN_Weights.IMAGENET1K_V1
. You can also use weights=VGG16_BN_Weights.DEFAULT
to get the most up-to-date weights.
warnings.warn(msg)
[INFO] 2024-10-03 17:15:07.533580 Loading weights from C:\Users\shruti.k\Downloads\Pix2Vox-A-ShapeNet.pth ...
Traceback (most recent call last):
File "C:\Users\shruti.k\Desktop\Pix2Vox\Pix2Vox\runner.py", line 93, in
Just remove "module." from the key names. If you don't know how to do it, please ask ChatGPT.
I am facing issue in runner.py as I am trying to use pretrained model on CPU . I have changed runner.py code accordingly for loading on CPU but still I am facing same error.
Can you please suggest how can this be fixed?