Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

AttributeError: 'ConfigDict' object has no attribute 'modelname'

Open zhangchen234 opened this issue 2 years ago • 1 comments

首先十分感谢作者杰出的贡献。 我在跑grounded_sam_inpainting_demo.py时,出现了错误AttributeError: 'ConfigDict' object has no attribute 'modelname'。定位到是GroundingDINO/groundingdino/util/slconfig.py文件的问题。用您给的例子测试了类slconfig,发现并不能得到一致的输出。

cfg = SLConfig.fromfile('/data1/test/a.py')
print(cfg.filename)
# "/data1/test/a.py"
print(cfg)
# 本应该是 :"Config [path: /home/kchen/projects/mmcv/tests/data/config/a.py]: "{'item1': [1, 2], 'item2': {'a': 0}, 'item3': True, 'item4': 'test'}"
# 输出是:Config (path: /data1/test/a.py): {}
print(cfg.item4)
# 本应该是: 'test'
# 报错:AttributeError: 'ConfigDict' object has no attribute 'item4'

没敢贸然改slconfig,而且没看到大家有提出这样的问题,所以有些奇怪。感谢作者以及如果有遇到过相同问题方便解答的人。

zhangchen234 avatar Apr 12 '23 13:04 zhangchen234

谢谢,我们会尽快测试并给出反馈

SlongLiu avatar Apr 12 '23 13:04 SlongLiu