Replies: 1 comment 1 reply
-
I forgot to mention I use this for the second call.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The paper is here:
The code and data link are here
I've created a directory structure locally as per the recommendations on Github, with images, weights and all (at least I think)
I transferred all of these files and directories to my Google Drive account, then in Colab,
cd /content/drive/MyDrive/BAID/
and then
!python test.py
100% 3200/3200 [00:00<00:00, 915474.58it/s] Traceback (most recent call last): File "/content/drive/MyDrive/BAID/test.py", line 75, in <module> test(args) File "/content/drive/MyDrive/BAID/test.py", line 37, in test model = SAAN(num_classes=1) File "/content/drive/MyDrive/BAID/models/model.py", line 101, in __init__ self.GenAes = GAB() File "/content/drive/MyDrive/BAID/models/model.py", line 79, in __init__ self._init_weights() File "/content/drive/MyDrive/BAID/models/model.py", line 94, in _init_weights self.model.load_state_dict(torch.load('checkpoint/ResNet_Pretrain/epoch_99.pth'), File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1014, in load return _load(opened_zipfile, File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1422, in _load result = unpickler.load() File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1392, in persistent_load typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location)) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1366, in load_tensor wrap_storage=restore_location(storage, location), File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 381, in default_restore_location result = fn(storage, location) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 274, in _cuda_deserialize device = validate_cuda_device(location) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 258, 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.
and I also tried with a GPU (By the way I'm on the free version of Colab at the moment.
I change the workspace to gpu and ran this.
100% 3200/3200 [00:00<00:00, 686957.35it/s] Traceback (most recent call last): File "/content/drive/MyDrive/BAID/test.py", line 75, in <module> test(args) File "/content/drive/MyDrive/BAID/test.py", line 37, in test model = SAAN(num_classes=1) File "/content/drive/MyDrive/BAID/models/model.py", line 101, in __init__ self.GenAes = GAB() File "/content/drive/MyDrive/BAID/models/model.py", line 79, in __init__ self._init_weights() File "/content/drive/MyDrive/BAID/models/model.py", line 94, in _init_weights self.model.load_state_dict(torch.load('checkpoint/ResNet_Pretrain/epoch_99.pth'), File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1014, in load return _load(opened_zipfile, File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1422, in _load result = unpickler.load() File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1392, in persistent_load typed_storage = load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location)) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 1366, in load_tensor wrap_storage=restore_location(storage, location), File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 381, in default_restore_location result = fn(storage, location) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 274, in _cuda_deserialize device = validate_cuda_device(location) File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 265, in validate_cuda_device raise RuntimeError('Attempting to deserialize object on CUDA device ' RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.
I'm a complete newbie with all this and I have no clue. Maybe someone came across a similar problem and would have some suggestions.
Regards,
Yves
Beta Was this translation helpful? Give feedback.
All reactions