D:\Program Files\Python310\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(
D:\Program Files\Python310\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=ResNet18_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet18_Weights.DEFAULT` to get the most up-to-date weights.
warnings.warn(msg)
Traceback (most recent call last):
File "E:\3D-Reconstruction\3DSfMFaceReconstruction\FaceLandmark\Facial_landmark.py", line 15, in <module>
net.load_state_dict(torch.load('./model/model_keypoints_800pts_iter_final.pt'))
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 795, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 1012, in _legacy_load
result = unpickler.load()
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 958, in persistent_load
wrap_storage=restore_location(obj, location),
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 215, in default_restore_location
result = fn(storage, location)
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
File "D:\Program Files\Python310\lib\site-packages\torch\serialization.py", line 166, in validate_cuda_device
raise RuntimeError('Attempting to deserialize object on a CUDA '
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.