TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.54k stars 1.31k forks source link

Minor: automatic1111 cannot Interrogate CLIP #194

Open lgrkvst opened 2 years ago

lgrkvst commented 2 years ago

This is what I'm getting:

load checkpoint from https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_caption_capfilt_large.pth
100%|████████████████████████████████████████| 890M/890M [00:08<00:00, 106MiB/s]
Error interrogating
Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 137, in interrogate
    caption = self.generate_caption(pil_image)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 122, 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 "/content/gdrive/MyDrive/sd/stable-diffusion/src/blip/models/blip.py", line 163, in generate
    **model_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py", line 1207, in generate
    self._validate_model_kwargs(model_kwargs.copy())
  File "/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py", line 910, in _validate_model_kwargs
    f"The following `model_kwargs` are not used by the model: {unused_model_args} (note: typos in the"
ValueError: The following `model_kwargs` are not used by the model: ['encoder_hidden_states', 'encoder_attention_mask'] (note: typos in the generate arguments will also show up in this list)

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 137, in interrogate
    caption = self.generate_caption(pil_image)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 122, 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 "/content/gdrive/MyDrive/sd/stable-diffusion/src/blip/models/blip.py", line 163, in generate
    **model_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py", line 1207, in generate
    self._validate_model_kwargs(model_kwargs.copy())
  File "/usr/local/lib/python3.7/dist-packages/transformers/generation_utils.py", line 910, in _validate_model_kwargs
    f"The following `model_kwargs` are not used by the model: {unused_model_args} (note: typos in the"
ValueError: The following `model_kwargs` are not used by the model: ['encoder_hidden_states', 'encoder_attention_mask'] (note: typos in the generate arguments will also show up in this list)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/gradio/routes.py", line 274, in run_predict
    fn_index, raw_input, username, session_state, iterators
  File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 742, in process_api
    result = await self.call_function(fn_index, inputs, iterator)
  File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 654, in call_function
    block_fn.fn, *processed_input, limiter=self.limiter
  File "/usr/local/lib/python3.7/dist-packages/anyio/to_thread.py", line 32, in run_sync
    func, *args, cancellable=cancellable, limiter=limiter
  File "/usr/local/lib/python3.7/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/usr/local/lib/python3.7/dist-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 370, in interrogate
    prompt = shared.interrogator.interrogate(image)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/interrogate.py", line 167, in interrogate
    res += "<error>"
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
TheLastBen commented 2 years ago

Keep your repo update, AUTOMATIC1111 will probably fix that soon