module 'torch.nn' has no attribute 'Modul'
时间: 2023-08-14 17:04:30 浏览: 163
这个问题是由于在使用torch.nn模块时出现了错误。根据引用的信息,可以尝试打开torch/nn路径下的模块文件,查看是否有需要修正的代码。具体来说,你可以检查是否有类似于引用中提到的问题,即模块对象没有所需的属性。检查报错信息中提到的文件和行数,修改相应位置的代码,确保正确的属性被使用。这样应该可以解决你遇到的问题。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [torch_dct中解决AttributeError: module ‘torch‘ has no attribute ‘rfft](https://blog.csdn.net/weixin_44412718/article/details/128162596)[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]
- *2* *3* [报错torch.nn.modules.module.ModuleAttributeError: ‘Hardswish‘ object has no attribute ‘inplace](https://blog.csdn.net/weixin_44942126/article/details/120184159)[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]
[ .reference_list ]
阅读全文