属性错误:AttributeError: module 'xxx' has no attribute 'xxx' - ouyuming/AiLearn GitHub Wiki
一、属性错误逻辑梳理
- (一)报错特征
- 控制台报错:AttributeError: module 'xxx' has no attribute 'xxx'
- 关联报错:Cannot find reference 'xxx' in 'init.py'
- (二)图片示例
- 示例1:
AttributeError: module 'torchvision' has no attribute 'CIFAR10'
Cannot find reference 'CIFAR10' in 'init.py'
- 示例2:
AttributeError: module 'concurrent' has no attribute 'futures'
Cannot find reference 'futures' in 'init.pyi'
- (三)总结原因与解决方案逻辑梳理
- 总结版:同名或包缺失
https://blog.csdn.net/weixin_35737303/article/details/80203586
- 该模块缺乏该包
- 脚本名字与脚本中引入的包名重合
https://blog.csdn.net/weixin_45189629/article/details/101270030
- 关联错误解决方案(执行后没效果)
二、真正问题:自己打错代码!!!
- (一)问题描述
- 路径打错,缺少dataset,导致编译器找不到路径
- 图片展示