AttributeError: module 'torch' has no attribute 'compile'
时间: 2023-08-29 13:05:10 浏览: 417
d2l中的torch模块
引用中提到,这个问题可能是因为pytorch没有配置GPU/CUDA,导致torch模块无法正常加载。要解决这个问题,你可以按照以下步骤进行操作:
1. 确保已经正确安装并配置了GPU/CUDA。你可以从pytorch官网下载适合你的系统和CUDA版本的pytorch,并按照官方文档进行安装和配置。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [关于AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘问题的解决](https://blog.csdn.net/qq_39578356/article/details/108575978)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [pycharm报错:AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice](https://blog.csdn.net/weixin_43978384/article/details/120343331)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文