Skip to content

[Bug]: 安装后会显示没有sam模型,手动安装groundingdino_swinb后会显示keyError #210

@lizhaorui10

Description

@lizhaorui10

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

Have you updated WebUI and this extension to the latest version?

  • I have updated WebUI and this extension to the latest version

Do you understand that you should read the 1st item of https://github.com/continue-revolution/sd-webui-segment-anything#faq if you cannot install GroundingDINO?

  • My problem is not about installing GroundingDINO

Do you understand that you should use the latest ControlNet extension and enable external control if you want SAM extension to control ControlNet?

  • I have updated ControlNet extension and enabled "Allow other script to control this extension"

Do you understand that you should read the 2nd item of https://github.com/continue-revolution/sd-webui-segment-anything#faq if you observe problems like AttributeError bool object has no attribute enabled and TypeError bool object is not subscriptable?

  • My problem is not about such issue, otherwise I have tried changing the extension directory name from sd-webui-segment-anything to a1111-sd-webui-segment-anything

What happened?

安装后会显示没有sam模型,手动安装groundingdino_swinb后会显示KeyError: 'groundingdino_swinb'

Steps to reproduce the problem

  1. 点击“预览分离结果”
  2. 显示“错误”
  3. 控制台显示KeyError: 'groundingdino_swinb'

What should have happened?

正常运行

Commit where the problem happens

webui: img2img
extension: Segment Anything

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

Console logs

Start SAM Processing
Initializing SAM to cuda
Traceback (most recent call last):
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\sd-webui-aki-v4.4\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "D:\sd-webui-aki-v4.4\extensions\a1111-sd-webui-segment-anything\scripts\sam.py", line 204, in sam_predict
    sam = init_sam_model(sam_model_name)
  File "D:\sd-webui-aki-v4.4\extensions\a1111-sd-webui-segment-anything\scripts\sam.py", line 129, in init_sam_model
    sam_model_cache[sam_model_name] = load_sam_model(sam_model_name)
  File "D:\sd-webui-aki-v4.4\extensions\a1111-sd-webui-segment-anything\scripts\sam.py", line 80, in load_sam_model
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint_path)
KeyError: 'groundingdino_swinb'

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions