运行pytorch时报错——AttributeError: module 'torch.nn' has no attribute 'ModuleDict'
2020.2月的最后两个多小时,下次相遇2.29号就要等到四年后了~~
很神奇的一个月,学生生涯的最后一个假期,没想到竟是最长的一次...还是想祝福每位朋友,无论这段时间境况如何,都要稳稳地走下去,生活真的是坎坎坷坷,跌跌停停,愿你我都能平安,快乐。
继续记录小的知识点吧,昨天运行pytorch时报了错:AttributeError: module 'torch.nn' has no attribute 'ModuleDict'。查了些资料。很少有关于这个错误的,最后去github上看了下讨论区,总结了下,是版本的问题,更准确地说是torchvision的版本,我装的是0.4.1,然后卸载掉,使用以下命令安装了0.2.2版本:
pip install torchvision==0.2.2
其实之前因为torch(现在装的是0.4.0版本)和torchvision的版本问题搞得有点懵,相互之间存在冲突,关于配置环境的相关问题大家建议大家在最初就安装和谐的版本,不然后期会出现各种麻烦;还有就是最好使用Anaconda创建虚拟环境,这样不至于一步走错,满盘皆输。
还有一个小问题就是在pycharm中调用同目录文件时会报错,但一般不会影响运行,这是因为他没有将该目录作为源路径,搜索出错,此时可设置该目录为源路径
运行pytorch时报错——AttributeError: module 'torch.nn' has no attribute 'ModuleDict'相关推荐
- AttributeError: module 'torch.nn' has no attribute 'LocalResponseNorm'问题的解决办法
错误如下: AttributeError: module 'torch.nn' has no attribute 'LocalResponseNorm' 错误原因: 我在Windows装的pytorc ...
- 关于AttributeError: module ‘torch.nn‘ has no attribute ‘Moudle‘的解决方法
注意拼写! 注意拼写! 注意拼写! 注意看看U是第几个字母 是 Mo-du-le 不是moudle
- AttributeError: module 'torch.nn.init' has no attribute 'zeros_'
问题 File "E:\wj-lab\expStad\model.py", line 50, in __init__feat_block.apply(weights_init_ka ...
- 导入torchvision出现:AttributeError: module ‘torch.jit‘ has no attribute ‘unused‘错误
导入torchvision出现:AttributeError: module 'torch.jit' has no attribute 'unused'错误 文章目录: 1 问题原因 2 解决方法 我 ...
- 成功解决AttributeError: module 'torch.utils' has no attribute 'data'
成功解决AttributeError: module 'torch.utils' has no attribute 'data' 目录 解决问题 解决思路 解决方法 解决问题 AttributeErr ...
- AttributeError: module ‘torch.distributed‘ has no attribute ‘_all_gather_base‘
问题描述 安装完apex后,调用的是时候出现如下错误: File "/home/shuyuan/anaconda3/envs/shuyuan/lib/python3.8/site-packa ...
- 【Flask】flask-bootstrap报错AttributeError: module ‘dominate.tags‘ has no attribute ‘input‘解决方法
问题 在使用flask-bootstrap渲染表单时,报错AttributeError: module 'dominate.tags' has no attribute 'input'. 解决方法 修 ...
- python报错AttributeError module ‘scipy.misc‘ has no attribute ‘imresize‘和 ‘imread‘
python报错AttributeError: module 'scipy.misc' has no attribute 'imresize'和 'imread' 报错原因:scipy版本过高 解决方 ...
- Vue:运行项目时报错:Module not found: Error: Can't resolve 'sass-loader' in
报错内容: 原因: 不能解析sass-loader 解决: 在项目中引入 ↓ npm install sass-loader -D npm install node-sass -D tips:使用淘宝 ...
最新文章
- 接口限流算法:漏桶算法令牌桶算法
- 软件测试论坛_浅谈软件测试的未来,我们该如何做好准备
- 我能使用这个Intent吗?
- C++异常实现与longjmp, setjmp,栈指针EBP, Active Record
- wordpress content.php,2020主题:content.php
- [C语言]一个很实用的服务端和客户端进行UDP通信的实例
- php生成文章页,php结合smarty生成静态页面php文章内分页代码
- RS232电平 RS485电平 RS422电平 TTL电平
- win2012没有远程桌面授权服务器可以提供许可证 如何远程
- PTA 数据结构与算法题目集(中文) 7-49 打印学生选课清单 (25分)题解
- python把int转为str_python中int与str互转方法
- 32位计算机64位计算机实质,4G内存电脑安装32位还是64位win7系统?实际详细性能测试!...
- 【Python】解决使用 plt.savefig 保存图片时一片空白
- Elasticsearch应用案例1:百度
- 百度视频在Android和iOS端性能测试方法
- Flowable入门系列文章47 - 电子邮件任务
- Digital Clock 3D for Mac(3D机械时钟动态桌面壁纸)
- PTA 7-14 电话聊天狂人(25 分)map的应用
- 怎么判断一个数字是否是快乐数
- wro4j和maven plugin在编译期间压缩静态资源.