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

[Bug]: CLIP Interrogation crashes #10

Closed
1 task done
steyRNG opened this issue Feb 21, 2023 · 6 comments
Closed
1 task done

[Bug]: CLIP Interrogation crashes #10

steyRNG opened this issue Feb 21, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@steyRNG
Copy link

steyRNG commented Feb 21, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

Tried interrogating an Image in img2img with CLIP, but got this crash and in the prompts box.

Since my GPU is neither CUDA nor HIP due to being on Win11, this crash happens. Maybe put CPU as a Fallback Default?

Steps to reproduce the problem

  1. Start webui-user.bat
  2. Open IMG2IMG
  3. Put any Picture in the Box
  4. Press "Interrogate CLIP"
  5. ???
  6. Crash

What should have happened?

CLIP Output in Prompt, no Crash in Console.

Commit where the problem happens

c888249

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--opt-split-attention-v1 --opt-sub-quad-attention --autolaunch --no-half --disable-nan-check --precision full

List of extensions

image

Console logs

load checkpoint from G:\Other\AI\stable-diffusion-webui-directml\models\BLIP\model_base_caption_capfilt_large.pth
Error interrogating
Traceback (most recent call last):
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\interrogate.py", line 198, in interrogate
    caption = self.generate_caption(pil_image)
  File "G:\Other\AI\stable-diffusion-webui-directml\modules\interrogate.py", line 183, in generate_caption
    caption = self.blip_model.generate(gpu_image, sample=False, num_beams=shared.opts.interrogate_clip_num_beams, min_length=shared.opts.interrogate_clip_min_length, max_length=shared.opts.interrogate_clip_max_length)
  File "G:\Other\AI\stable-diffusion-webui-directml\repositories\BLIP\models\blip.py", line 156, in generate
    outputs = self.text_decoder.generate(input_ids=input_ids,
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\generation\utils.py", line 1518, in generate
    return self.greedy_search(
  File "G:\Other\AI\stable-diffusion-webui-directml\venv\lib\site-packages\transformers\generation\utils.py", line 2267, in greedy_search
    unfinished_sequences = input_ids.new(input_ids.shape[0]).fill_(1)
RuntimeError: new(): expected key in DispatchKeySet(CPU, CUDA, HIP, XLA, MPS, IPU, XPU, HPU, Lazy, Meta) but got: PrivateUse1

Additional information

CPU: 5950x
RAM: 32GB
GPU: 7900 XTX
VRAM: 24GB

@steyRNG
Copy link
Author

steyRNG commented Feb 21, 2023

Workaround btw is adding "--use-cpu interrogate" to the cmdline args for anyone having the same issue

@lshqqytiger lshqqytiger added the bug Something isn't working label Feb 24, 2023
@lshqqytiger
Copy link
Owner

I added a fall back to cpu.

@Miraihi
Copy link

Miraihi commented Feb 25, 2023

--use-cpu interrogate doesn't work for me. Only solution I found is the "tagger" extension. It allows you to get booru-style tags for the prompt. Not CLIP but at least something, considering that the native DeepBooru doesn't work as well (Produces the same inaccurate set of tags for any image).

@lshqqytiger lshqqytiger reopened this Feb 26, 2023
@lshqqytiger
Copy link
Owner

There is a same issue on DirectML repo, it was a problem of pytorch.
PyTorch team fixed it, but fixed version is not released yet.

@Omniphantasm
Copy link

Any work around for this that we can do on our end for now?

Kinda sucks not being able to interrogate 😆

@Miraihi
Copy link

Miraihi commented Mar 7, 2023

Any work around for this that we can do on our end for now?

Kinda sucks not being able to interrogate 😆

Just what I've already mentioned above: "tagger" extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants