unprompted icon indicating copy to clipboard operation
unprompted copied to clipboard

Segment Anything not wroking

Open MotherSoraka opened this issue 1 year ago • 4 comments

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 avatar May 03 '23 12:05 MotherSoraka

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 avatar May 03 '23 12:05 MotherSoraka

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

MotherSoraka avatar May 10 '23 13:05 MotherSoraka

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

aphix avatar May 16 '23 19:05 aphix

Same issue here

LGlassySky avatar Jul 02 '23 07:07 LGlassySky