SDT
SDT copied to clipboard
如何在intel Mac 不用gpu只用cpu?
如题,我无法使用cuda,每次都报错,想看看能不能换成cpu,时间长点没关系
或者大佬能不能帮我看看为啥cuda会报错:
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/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.11/lib/python3.11/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 "/Users/shuang/Downloads/SDT-master 2/test.py", line 115, in
搜索一下代码里面,主要是train.py
和test.py
,把cuda
改成cpu
就好
改完了,但他又报这个错了😂:FileNotFoundError: [Errno 2] No such file or directory: 'checkpoint_path' 请问要把checkpoint-iter199999.pth放哪里啊? 谢谢!
改完了,但他又报这个错了😂:FileNotFoundError: [Errno 2] No such file or directory: 'checkpoint_path' 请问要把checkpoint-iter199999.pth放哪里啊? 谢谢!
随便放个地方,然后把路径记下来,替换掉checkpoint_path
就好啦
又报了这个错😓: 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.
把test.py
中的第41行改成model_weight = torch.load(opt.pretrained_model, map_location='cpu')
这又是啥原因?TypeError: cannot pickle 'Environment' object
这又是啥原因?TypeError: cannot pickle 'Environment' object
参见issue#23,把test.py
里的DataLoader
的num_workers
改成0
好像cuda又出问题了:AssertionError: Torch not compiled with CUDA enabled
好像cuda又出问题了:AssertionError: Torch not compiled with CUDA enabled
等我抽空整理一个cpu版本