module 'torch' has no attribute 'pi'
时间: 2023-09-09 14:05:59 浏览: 664
根据提供的引用内容,您遇到的问题是关于在使用torch模块时出现"module 'torch' has no attribute 'pi'"的错误。根据引用中的解决办法,您可以尝试以下步骤来解决该问题:
1. 首先,您可以尝试将torch版本降级到1.9.1,通过运行以下命令卸载当前的torch版本:
```
pip uninstall torch
```
然后,安装torch版本1.9.1:
```
pip install torch==1.9.1
```
2. 如果您想查看torch中的py文件,可以根据引用中的提示,在anaconda环境中找到torch的安装位置。具体而言,可以在以下路径中找到torch的py文件:
```
/envs/your_env_name/lib/python版本号/site-packages/torch
```
其中,your_env_name是您的环境名称,版本号是您所使用的Python版本号。
3. 如果在查看torch的py文件时发现了'_six.py'文件,并且遇到了问题,请尝试重启Jupyter Kernel,根据引用中的提示,这可能会解决问题。
希望以上解决办法能够帮助您解决"module 'torch' has no attribute 'pi'"的问题。如果问题仍然存在,请提供更多的信息,以便我们能够更好地帮助您。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Pytorch出现错误Attribute Error: module ‘torch‘ has no attribute ‘_six](https://blog.csdn.net/qq_44727287/article/details/129903108)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文
相关推荐

















