-
Notifications
You must be signed in to change notification settings - Fork 44
Description
I am running on a macbook pro m2 and I met with the cuda problem. The error is as below:
___________________________start
tanyihan@ID-4289M Adeleine % python3 server.py --point ckpts/point_model.pt
Using cache found in /Users/tanyihan/.cache/torch/hub/RF5_danbooru-pretrained_master
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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(
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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=None.
warnings.warn(msg)
Traceback (most recent call last):
File "/Users/tanyihan/Documents/adeleine/Adeleine/server.py", line 213, in
main(args)
File "/Users/tanyihan/Documents/adeleine/Adeleine/server.py", line 31, in main
point_infer = PointInferer(str(args.point))
File "/Users/tanyihan/Documents/adeleine/Adeleine/point/inference.py", line 15, in init
self.model = self._model_load(pretrain_path)
File "/Users/tanyihan/Documents/adeleine/Adeleine/point/inference.py", line 24, in _model_load
model = Generator(in_ch=5,
File "/Users/tanyihan/Documents/adeleine/Adeleine/point/model.py", line 653, in init
self.se = AtariEncoder(out_ch=base*8,
File "/Users/tanyihan/Documents/adeleine/Adeleine/point/model.py", line 557, in init
ResNet(),
File "/Users/tanyihan/Documents/adeleine/Adeleine/point/model.py", line 163, in init
self.model = torch.hub.load('RF5/danbooru-pretrained', 'resnet50')
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/hub.py", line 558, in load
model = _load_local(repo_or_dir, model, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/hub.py", line 587, in _load_local
model = entry(*args, **kwargs)
File "/Users/tanyihan/.cache/torch/hub/RF5_danbooru-pretrained_master/danbooru_resnet.py", line 133, in resnet50
state = torch.hub.load_state_dict_from_url("https://github.com/RF5/danbooru-pretrained/releases/download/v0.1/resnet50-13306192.pth",
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/hub.py", line 750, in load_state_dict_from_url
return torch.load(cached_file, map_location=map_location)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/serialization.py", line 1043, in _legacy_load
result = unpickler.load()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/serialization.py", line 980, in persistent_load
wrap_storage=restore_location(obj, location),
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/serialization.py", line 217, in default_restore_location
result = fn(storage, location)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/torch/serialization.py", line 182, in _cuda_deserialize
device = validate_cuda_device(location)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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.
___________________________end
Do I need a laptop with NVIDIA to run this code?