Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行trai.py时总是提示AssertionError: Torch not compiled with CUDA enabled怎么办,求教 #168

Open
yummyX02 opened this issue Apr 21, 2023 · 0 comments

Comments

@yummyX02
Copy link

Traceback (most recent call last):
File "D:\pycharm\Anaconda\setUp\lib\site-packages\IPython\core\interactiveshell.py", line 3457, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('D:/deepLearning/pytorch/yolo3-pytorch-master/train.py', wdir='D:/deepLearning/pytorch/yolo3-pytorch-master')
File "D:\pycharm\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\pycharm\PyCharm 2021.3.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/deepLearning/pytorch/yolo3-pytorch-master/train.py", line 325, in
model_train = model_train.cuda()
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 749, in cuda
return self._apply(lambda t: t.cuda(device))
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 641, in _apply
module._apply(fn)
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 641, in _apply
module._apply(fn)
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 641, in _apply
module._apply(fn)
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 664, in _apply
param_applied = fn(param)
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\nn\modules\module.py", line 749, in
return self.apply(lambda t: t.cuda(device))
File "D:\pycharm\Anaconda\setUp\lib\site-packages\torch\cuda_init
.py", line 221, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant