IDEA-Research / Grounded-Segment-Anything

Grounded SAM: Marrying Grounding DINO with Segment Anything & Stable Diffusion & Recognize Anything - Automatically Detect , Segment and Generate Anything
https://arxiv.org/abs/2401.14159
Apache License 2.0
15.16k stars 1.4k forks source link

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

Open zhangchen234 opened 1 year ago

zhangchen234 commented 1 year ago

首先十分感谢作者杰出的贡献。 我在跑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,而且没看到大家有提出这样的问题,所以有些奇怪。感谢作者以及如果有遇到过相同问题方便解答的人。

SlongLiu commented 1 year ago

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