Python 属性错误:模块';圣公会馈线和x27;没有属性';Feeder_newdataset';

Python 属性错误:模块';圣公会馈线和x27;没有属性';Feeder_newdataset';,python,python-3.x,module,Python,Python 3.x,Module,我正在尝试为新数据集运行github存储库。为此,我以与其他数据集类似的方式向读取数据的模块添加了一个新的数据集文件 但是,当我运行脚本时,会出现一个错误,显示: AttributeError:模块“st_gcn.feeder”没有属性“feeder_newdataset” project ├── feeder │ └── feeder.py | └── feeder.pyc │ └── __init__.py | └── __init__.pyc │ └── tools.p

我正在尝试为新数据集运行github存储库。为此,我以与其他数据集类似的方式向读取数据的模块添加了一个新的数据集文件

但是,当我运行脚本时,会出现一个错误,显示:

AttributeError:模块“st_gcn.feeder”没有属性“feeder_newdataset”

project
├── feeder
│   └── feeder.py
|   └── feeder.pyc
│   └── __init__.py
|   └── __init__.pyc
│   └── tools.py
|   └── tools.pyc
│   └── feeder_olddataset.py
|   └── feeder_olddataset.pyc
│   └── feeder_newdataset.py
│   └── __pycache__
    │   ├── feeder.cpython-35.pyc
    │   └── __init__.cpython-35.pyc
    │   ├── feeder.cpython-35.pyc
    │   └── __init__.cpython-35.pyc
    │   ├── feeder.cpython-35.pyc
    │   └── feeder_olddataset.cpython-35.pyc.pyc
当我运行该项目时,缓存不会用新的数据集更新,我还尝试使用python3-m compileall-b项目编译所有项目文件

我想知道为什么在为新数据集添加class属性时会出现此错误。这和pycache有什么关系吗??如何更新此文件以包含新数据集

编辑:


我已经对所有名称进行了双重和三重检查,基本上代码在检查组件是否存在时失败:

def import_class(name):
    components = name.split('.') #name: st_gcn.feeder.Feeder_newdataset
    mod = __import__(components[0]) #components:
    for comp in components[1:]:
        mod = getattr(mod, comp) #comp: 'Feeder_newdataset'
    return mod

我想它失败是因为mod=import(components[0])此行无法使用uu init找到Feeder\u newdataset属性,我认为缓存没有任何问题。但我建议您检查模块st_gcn.feeder。属性my可能不在新数据集中,或者您必须重命名itI。我对所有名称进行了双重三重检查,基本上,代码在检查组件是否存在时失败:def import_class(name):components=name.split('.')name:st_gcn.feeder.feeder_newdataset mod=u import_u(components[0])#components:for comp in components[1:]:mod=getattr(mod,comp)#comp:'Feeder\u newdataset'返回modI假设它失败,因为mod=import\uuuuuuuuuuuuuuuuu(组件[0])此行无法使用uuuuuu initOk找到Feeder\u newdataset属性,愚蠢的我,原来init文件也有一些导入(我使用的是github repo):from.feeder\u newdataset导入feeder\u newdataset我添加了这一行并解决了所有问题。不过感谢您的评论