module 'torch' has no attribute 'Sequential'
时间: 2023-08-04 12:04:22 浏览: 250
这个错误是因为在torch模块中没有名为'Sequential'的属性。\[3\]根据错误提示,你可能在代码中使用了torch.nn.Sequential,但是torch模块中并没有这个属性。要解决这个问题,你可以尝试使用torch.nn.ModuleList或者torch.nn.Sequential来替代torch.nn.Sequential。这两个类都可以用来定义神经网络的层。
#### 引用[.reference_title]
- *1* *3* [Pytorch 1.0.0版本问题(一)之module ‘torch.nn‘ has no attribute ‘Flatten](https://blog.csdn.net/lry320/article/details/119107794)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [module torch has no attribute empyt如何解决?](https://blog.csdn.net/fwj_ntu/article/details/86714817)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文