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]: Many errors for a docker install (rocm) #16168

Closed
6 tasks done
markg85 opened this issue Jul 7, 2024 · 2 comments
Closed
6 tasks done

[Bug]: Many errors for a docker install (rocm) #16168

markg85 opened this issue Jul 7, 2024 · 2 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@markg85
Copy link

markg85 commented Jul 7, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

Application crashes at startup

Steps to reproduce the problem

See console log

What should have happened?

See console log

What browsers do you use to access the UI ?

No response

Sysinfo

See console log

Console logs

REQS_FILE='requirements.txt' python launch.py --precision full --no-half
Python 3.9.19 (main, Mar 21 2024, 17:11:28)
[GCC 11.2.0]
Version: v1.9.4-244-g1da49079
Commit hash: 1da490792794e135ba8f0d7b8c78ddab564d7530
Launching Web UI with arguments: --precision full --no-half
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Pytorch_lightning.distributed not found, attempting pytorch_lightning.rank_zero
*** Error loading script: xyz_grid.py
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 515, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/dockerx/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 846, in exec_module
      File "<frozen importlib._bootstrap_external>", line 983, in get_code
      File "<frozen importlib._bootstrap_external>", line 913, in source_to_code
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "/dockerx/stable-diffusion-webui/scripts/xyz_grid.py", line 121
        match name := name.lower().strip():
              ^
    SyntaxError: invalid syntax

---
*** Error loading script: lora_script.py
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 515, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/dockerx/stable-diffusion-webui/modules/script_loading.py", line 13, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 850, in exec_module
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "/dockerx/stable-diffusion-webui/extensions-builtin/Lora/scripts/lora_script.py", line 7, in <module>
        import networks
      File "/dockerx/stable-diffusion-webui/extensions-builtin/Lora/networks.py", line 595, in <module>
        def process_network_files(names: list[str] | None = None):
    TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'

---
*** Error executing callback before_ui for /dockerx/stable-diffusion-webui/extensions-builtin/hypertile/scripts/hypertile_script.py
Loading weights [6ce0161689] from /dockerx/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/script_callbacks.py", line 397, in before_ui_callback
        c.callback()
      File "/dockerx/stable-diffusion-webui/extensions-builtin/hypertile/scripts/hypertile_script.py", line 107, in add_axis_options
        xyz_grid = [x for x in scripts.scripts_data if x.script_class.__module__ == "xyz_grid.py"][0].module
    IndexError: list index out of range

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for Hypertile:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
*** Error creating UI for None:
    Traceback (most recent call last):
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 640, in create_script_ui
        self.create_script_ui_inner(script)
      File "/dockerx/stable-diffusion-webui/modules/scripts.py", line 645, in create_script_ui_inner
        import modules.api.models as api_models
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 100, in <module>
        StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
      File "/dockerx/stable-diffusion-webui/modules/api/models.py", line 96, in generate_model
        DynamicModel.__config__.allow_population_by_field_name = True
      File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 237, in __getattr__
        raise AttributeError(item)
    AttributeError: __config__

---
Traceback (most recent call last):
  File "/dockerx/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/dockerx/stable-diffusion-webui/launch.py", line 44, in main
    start()
  File "/dockerx/stable-diffusion-webui/modules/launch_utils.py", line 469, in start
    webui.webui()
  File "/dockerx/stable-diffusion-webui/webui.py", line 64, in webui
    shared.demo = ui.create_ui()
  File "/dockerx/stable-diffusion-webui/modules/ui.py", line 489, in create_ui
    toprow.ui_styles.dropdown.change(fn=wrap_queued_call(update_token_counter), inputs=[toprow.prompt, steps, toprow.ui_styles.dropdown], outputs=[toprow.token_counter])
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/gradio/events.py", line 140, in __call__
    dep, dep_index = self.trigger.set_event_trigger(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/gradio/blocks.py", line 286, in set_event_trigger
    "inputs": [block._id for block in inputs],
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/gradio/blocks.py", line 286, in <listcomp>
    "inputs": [block._id for block in inputs],
AttributeError: 'NoneType' object has no attribute '_id'
Creating model from config: /dockerx/stable-diffusion-webui/configs/v1-inference.yaml
/opt/conda/envs/py_3.9/lib/python3.9/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Applying attention optimization: Doggettx... done.
Model loaded in 2.4s (load weights from disk: 0.1s, create model: 0.2s, apply weights to model: 1.7s, calculate empty prompt: 0.2s).

Additional information

Note that before this error, i had No module named 'pytorch_lightning.utilities.distributed' which was solved by following the fixes in this post.

After trying to start it i got the error of a missing module named timm so i installed that.
A subsequent run then gave me the above slew of errors.

It puzzled me because it begins with a syntax error claim:

      File "/dockerx/stable-diffusion-webui/scripts/xyz_grid.py", line 121
        match name := name.lower().strip():
              ^
    SyntaxError: invalid syntax

But i pulled that file through a python syntax verification tool and it had no issues...
Oh well, i'm not a python dev :)

Some more digging learned me that the match keyword in python is new since version 3.10.
The docker image has python 3.9.19..
Usually.... you could just use conda to install a specific version. But conda just doesn't want to activate in docker, i have no freaking clue why. Never had this before. I'm guessing it's magically going to work once this docker container is brought up to date.

@markg85 markg85 added the bug-report Report of a bug, yet to be confirmed label Jul 7, 2024
@w-e-w w-e-w mentioned this issue Jul 8, 2024
4 tasks
@w-e-w
Copy link
Collaborator

w-e-w commented Jul 8, 2024

@w-e-w w-e-w closed this as completed Jul 8, 2024
@markg85
Copy link
Author

markg85 commented Jul 8, 2024

That's fixed very quickly!

I can confirm that updating to python 3.10 works!
I couldn't update because conda wasn't initialized (how could i've known...). conda init bash made that part work after which i could activate conda environments just fine. That allowed me to get python 3.10 and voila, magic!

I do think this is either a "bug" in the docker container or just a missing step in configuring it.

Lastly, another issue i has was the need for explicitly installing pytorch (6.0) before i finally got hardware acceleration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants