Open Stone-0211 opened 7 months ago
搜索一下代码里面,主要是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版本
如题,我无法使用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
main(opt)
File "/Users/s/Downloads/SDT-master 2/test.py", line 39, in main
gly_dec_layers= cfg.MODEL.GLY_DEC_LAYERS).to('cuda')
^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1160, in to
return self._apply(convert)
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/nn/modules/module.py", line 833, in _apply
param_applied = fn(param)
^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/torch/cuda/init.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
None
for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passingweights=ResNet18_Weights.IMAGENET1K_V1
. You can also useweights=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