Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segment Anything not wroking #145

Open
MotherSoraka opened this issue May 3, 2023 · 4 comments
Open

Segment Anything not wroking #145

MotherSoraka opened this issue May 3, 2023 · 4 comments

Comments

@MotherSoraka
Copy link

after spending the entire day trying to install all the dependencies needed for Segment Anything, i get this error trying to use it instead of Clipseg:

Error running process: D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\scripts\unprompted.py
Traceback (most recent call last):
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shortcodes.py", line 137, in render
    return str(self.handler(self.token.keyword, self.pargs, self.kwargs, context, content))
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shared.py", line 78, in handler
    return(self.shortcode_objects[f"{keyword}"].run_block(pargs, kwargs, context, content))
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted/shortcodes\stable_diffusion\txt2mask.py", line 609, in run_block
    self.image_mask = get_mask().resize((self.init_image.width,self.init_image.height))
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted/shortcodes\stable_diffusion\txt2mask.py", line 442, in get_mask
    boxes_filt, pred_phrases = get_grounding_output(model, img, prompts[0], box_thresh, text_thresh, device=device)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted/shortcodes\stable_diffusion\txt2mask.py", line 337, in get_grounding_output
    outputs = model(image[None], captions=[caption])
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\groundingdino.py", line 313, in forward
    hs, reference, hs_enc, ref_enc, init_box_proposal = self.transformer(
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 258, in forward
    memory, memory_text = self.encoder(
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 576, in forward
    output = checkpoint.checkpoint(
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 249, in checkpoint
    return CheckpointFunction.apply(function, preserve, *args)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils\checkpoint.py", line 107, in forward
    outputs = run_function(*args)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\transformer.py", line 785, in forward
    src2 = self.self_attn(
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 338, in forward
    output = MultiScaleDeformableAttnFunction.apply(
  File "D:\Ai\1111\stable-diffusion-webui\venv\lib\site-packages\groundingdino\models\GroundingDINO\ms_deform_attn.py", line 53, in forward
    output = _C.ms_deform_attn_forward(
NameError: name '_C' is not defined
@MotherSoraka
Copy link
Author

MotherSoraka commented May 3, 2023

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Ai\1111\stable-diffusion-webui\modules\scripts.py", line 417, in process
    script.process(p, *script_args)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\scripts\unprompted.py", line 468, in process
    Unprompted.shortcode_user_vars["prompt"] = Unprompted.process_string(apply_prompt_template(original_prompt,Unprompted.Config.templates.default))
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shared.py", line 96, in process_string
    string = self.shortcode_parser.parse(self.sanitize_pre(string,self.Config.syntax.sanitize_before),context)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shortcodes.py", line 245, in parse
    return stack.pop().render(context)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shortcodes.py", line 59, in render
    return ''.join(child.render(context) for child in self.children)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shortcodes.py", line 59, in <genexpr>
    return ''.join(child.render(context) for child in self.children)
  File "D:\Ai\1111\stable-diffusion-webui\extensions\_unprompted\lib_unprompted\shortcodes.py", line 141, in render
    raise ShortcodeRenderingError(msg) from ex
lib_unprompted.shortcodes.ShortcodeRenderingError: An exception was raised while rendering the 'txt2mask' shortcode in line 1.

@MotherSoraka
Copy link
Author

Clip_Surgery isnt wroking either.
Redownlaoded and reinstalled the latest version of Automatic1111 and Unprompted on a new location with Torch 2, still getting the the same error

@aphix
Copy link

aphix commented May 16, 2023

Same issue here; tried manually installing requirements and no change-

@LGlassySky
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants