我正在尝试从this repo实现train.py文件,但是我遇到的错误是:
Traceback (most recent call last):
File "./src/train.py", line 74, in <module>
main()
File "./src/train.py", line 21, in main
model = MyModel0(len(VOCAB), 20, args.hidden_size).to(args.device)
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 426, in to
return self._apply(convert)
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 202, in _apply
module._apply(fn)
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 224, in _apply
param_applied = fn(param)
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 424, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py", line 192, in _lazy_init
_check_driver()
File "/home/guest/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py", line 95, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
即使#torch.backends.cudnn.enabled = False,我仍然遇到此错误。也许还有更多我不熟悉的GPU依赖项。我对PyTorch不太熟悉,有什么建议吗?