module 'torch' has no attribute 'concat'
时间: 2023-08-01 08:12:09 浏览: 404
导入FashionMNIST数据集时报错module ‘torchvision.datasets’ has no attribute ‘FashionMNIS’
根据引用\[1\]中的信息,你遇到的错误可能是因为pytorch版本改动导致的。在新版本中,torch.concat被改为了torch.cat。你可以尝试将代码中的torch.concat替换为torch.cat来解决这个问题。
另外,根据引用\[2\]中的信息,如果你在导入torchvision时遇到了"module 'torch' has no attribute '_utils_internal'"的错误,你可以尝试安装低版本的torchvision,使用命令"pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torchvision==0.4.1"来安装。
希望这些信息对你有帮助!
#### 引用[.reference_title]
- *1* [AttributeError: module ‘torch‘ has no attribute ‘concat](https://blog.csdn.net/Job_class/article/details/129972693)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [import torchvision报错module ‘torch‘ has no attribute ‘_utils_internal](https://blog.csdn.net/m0_52552810/article/details/127078224)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [YOLOV5中添加Task-Specific Context Decoupling](https://blog.csdn.net/weixin_45459097/article/details/130028804)[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^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文