Traceback (most recent call last): File "C:\Users\夏芷琳\Desktop\recommendation_model-master\DCN\dcn.py", line 200, in <module> model = DCN(feat_sizes, embedding_size, linear_feature_columns, dnn_feature_columns).to(device) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1145, in to return self._apply(convert) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply module._apply(fn) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 820, in _apply param_applied = fn(param) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1143, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking) File "D:\Anaconda\envs\pytorch\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled
时间: 2023-08-21 08:08:22 浏览: 414
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这是一个Python程序出现的错误,错误信息是 Torch not compiled with CUDA enabled。这个错误通常是因为你使用的PyTorch版本没有启用CUDA或CUDA安装出现问题。你可以检查你的PyTorch版本是否支持CUDA,或者重新安装PyTorch并确保安装了CUDA。
阅读全文