fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

TypeError: check_deprecated_parameters() missing 1 required keyword-only argument: 'kwargs'

Open utiaiarts opened this issue 7 months ago • 16 comments

When try to use this Google Collab https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast-DreamBooth.ipynb : Running from Connect to Drive until Training is working properly without any erros. BUT when running the Test The Trained Model, error below occurs:

Calculating sha256 for /content/gdrive/MyDrive/Fast-Dreambooth/Sessions/mltst/mltst.ckpt: 218063197008fa54ed8ec46690bfc86e2a8de66918f849f78d026c31c076bca4
Loading weights [2180631970] from /content/gdrive/MyDrive/Fast-Dreambooth/Sessions/mltst/mltst.ckpt
Creating model from config: /content/gdrive/MyDrive/sd/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Downloading vocab.json100% 961k/961k [00:00<00:00, 2.95MB/s]
Downloading merges.txt100% 525k/525k [00:00<00:00, 37.8MB/s]
Downloading (…)cial_tokens_map.json100% 389/389 [00:00<00:00, 2.49MB/s]
Downloading tokenizer_config.json100% 905/905 [00:00<00:00, 4.50MB/s]
Downloading config.json100% 4.52k/4.52k [00:00<00:00, 25.6MB/s]
Applying scaled dot product cross attention optimization.
Textual inversion embeddings loaded(0): 
Model loaded in 19.2s (calculate hash: 7.9s, load weights from disk: 5.6s, create model: 2.6s, apply weights to model: 1.6s, apply half(): 0.7s, move model to device: 0.7s).

Traceback (most recent call last):

  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 337, in <module>
    webui()
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 240, in webui
    shared.demo = modules.ui.create_ui();shared.demo.queue(concurrency_count=999999,status_update_rate=0.1)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 460, in create_ui
    with gr.Blocks(analytics_enabled=False) as txt2img_interface:
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 486, in __init__
    super().__init__(render=False, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 274, in __init__
    super().__init__(visible=visible, render=render, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 80, in __init__
    check_deprecated_parameters(self.__class__.__name__, **kwargs)
TypeError: check_deprecated_parameters() missing 1 required keyword-only argument: 'kwargs'

I Using Python 3 Google Compute Engine backend (GPU) (Collab Pro)

Please help to advice. Thank you!

utiaiarts avatar Nov 18 '23 12:11 utiaiarts

make sure gradio==3.16.2 is installed

TheLastBen avatar Nov 18 '23 18:11 TheLastBen

Screenshot 2023-11-19 at 8 16 15 AM

Hi @TheLastBen , please see the screenshot above. The gradio version is already installed with version 3.16.2, do you have any idea what should I do?

thank you

utiaiarts avatar Nov 19 '23 00:11 utiaiarts

try the latest notebook https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast-DreamBooth.ipynb, test it without the first, cell, do a test training for 20 steps and see if the error persists

TheLastBen avatar Nov 19 '23 03:11 TheLastBen

Hi @TheLastBen , I am facing the same problem using the latest notebook. What do you mean by "test it without the first, cell"? The first cell is loading the GDrive? And do I load my trained model to do the test training or do I test-train a new model? Thanks a lot!

chepy21 avatar Nov 19 '23 08:11 chepy21

Hi @TheLastBen , I am facing the same problem using the latest notebook. What do you mean by "test it without the first, cell"? The first cell is loading the GDrive? And do I load my trained model to do the test training or do I test-train a new model? Thanks a lot!

run it without the gdrive cell, use the default model, train for 20 steps just to be able to run the testing cell, and see if the error is the same

TheLastBen avatar Nov 19 '23 10:11 TheLastBen

Hi @TheLastBen , I followed your latest instructions and it worked. No error reported for Test The Trained Model cell. image

I can't load the previous session/test model without mounting GDrive, so what should we do? Very much appreciated!

chepy21 avatar Nov 19 '23 12:11 chepy21

rename your sd folder to sd_old

TheLastBen avatar Nov 21 '23 10:11 TheLastBen

I'm facing the same "TypeError: check_deprecated_parameters() missing 1 required keyword-only argument: 'kwargs'" error on Colab, but deleting the sd folder and letting it regenerate does not resolve the problem.

@chepy21 did you find a solution here?

markdjwilliams avatar Dec 05 '23 16:12 markdjwilliams

use the latest notebook

TheLastBen avatar Dec 05 '23 16:12 TheLastBen

its incompatibility w stable-diffusion-webui. u can try using updated gradio

!pip install cchardet
!pip install gradio==3.23.0 --no-deps -qq

try using gradio 3.23 and it works

Screen Shot 2024-01-06 at 12 55 14 AM

freshnewegg avatar Jan 06 '24 08:01 freshnewegg

its incompatibility w stable-diffusion-webui. u can try using updated gradio

!pip install cchardet
!pip install gradio==3.23.0 --no-deps -qq

try using gradio 3.23 and it works

Screen Shot 2024-01-06 at 12 55 14 AM

The same problem. I installed gradio 3.23.0 and now there is such an error

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 22, in <module>
    import gradio
  File "/usr/local/lib/python3.10/dist-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/usr/local/lib/python3.10/dist-packages/gradio/components.py", line 33, in <module>
    from gradio.blocks import Block, BlockContext
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 23, in <module>
    from gradio import (
ImportError: cannot import name 'encryptor' from partially initialized module 'gradio' (most likely due to a circular import) (/usr/local/lib/python3.10/dist-packages/gradio/__init__.py)

gitApier avatar Jan 07 '24 00:01 gitApier

i had that same error, you have to run the notebook from scratch. or uninstall the old gradio before you install the updated version.

freshnewegg avatar Jan 07 '24 00:01 freshnewegg

I got the same error, uninstalled and installed gradio - still didnt work. Same error persists,

tgashwinkumar avatar Jan 08 '24 07:01 tgashwinkumar

Same issue here - looks like the webui.py is throwing the error:

Traceback (most recent call last): File "/content/drive/MyDrive/sd/stable-diffusion-webui/webui.py", line 337, in webui() File "/content/drive/MyDrive/sd/stable-diffusion-webui/webui.py", line 240, in webui shared.demo = modules.ui.create_ui();shared.demo.queue(concurrency_count=999999,status_update_rate=0.1) File "/content/drive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 460, in create_ui with gr.Blocks(analytics_enabled=False) as txt2img_interface: File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 486, in init super().init(render=False, **kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 274, in init super().init(visible=visible, render=render, **kwargs) File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 80, in init check_deprecated_parameters(self.class.name, **kwargs) TypeError: check_deprecated_parameters() missing 1 required keyword-only argument: 'kwargs'

AIHomeKisr avatar Jan 21 '24 12:01 AIHomeKisr

Having the same problem, tried with gradio==3.23.0 and the problem persists

  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 22, in <module>
    import gradio
  File "/usr/local/lib/python3.10/dist-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/base.py", line 29, in <module>
    from gradio.blocks import Block, BlockContext
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 23, in <module>
    from gradio import (
ImportError: cannot import name 'encryptor' from partially initialized module 'gradio' (most likely due to a circular import) (/usr/local/lib/python3.10/dist-packages/gradio/__init__.py)```

Alejandro13Rob avatar Jan 26 '24 23:01 Alejandro13Rob

Same here after installing gradio==3.23.0

Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 22, in <module>
    import gradio
  File "/usr/local/lib/python3.10/dist-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "/usr/local/lib/python3.10/dist-packages/gradio/components/base.py", line 29, in <module>
    from gradio.blocks import Block, BlockContext
  File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 23, in <module>
    from gradio import (
ImportError: cannot import name 'encryptor' from partially initialized module 'gradio' (most likely due to a circular import) (/usr/local/lib/python3.10/dist-packages/gradio/__init__.py)

SetupCoding avatar Feb 04 '24 21:02 SetupCoding