kalaspuff / stable-diffusion-webui-controlnet-docker

🧑‍🎨 Stable Diffusion WebUI + ControlNet extension running in Docker. Built Docker image to be run as a Space at Hugging Face.
https://huggingface.co/spaces/carloscar/stable-diffusion-webui-controlnet-docker
31 stars 6 forks source link

crashes at startup (torchmetrics error) #4

Open DaemonSnake opened 1 year ago

DaemonSnake commented 1 year ago

Hi The image crashes when starting the ui on a torchmetrics error

---------------
Launching Web UI with arguments: --listen --ui-config-file ui-config.json --ui-settings-file config.json --disable-console-progressbars --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --enable-console-prompts --no-download-sd-model --api --skip-version-check --force-enable-xformers --xformers --enable-insecure-extension-access
---------------
Traceback (most recent call last):
  File "/app/stable-diffusion-webui/run.py", line 55, in <module>
    start()
  File "/app/stable-diffusion-webui/run.py", line 19, in start
    import webui  # type: ignore  # noqa
  File "/app/stable-diffusion-webui/webui.py", line 28, in <module>
    from modules import extra_networks, ui_extra_networks_checkpoints
  File "/app/stable-diffusion-webui/modules/ui_extra_networks_checkpoints.py", line 5, in <module>
    from modules import shared, ui_extra_networks, sd_models
  File "/app/stable-diffusion-webui/modules/sd_models.py", line 17, in <module>
    from modules.sd_hijack_inpainting import do_inpainting_hijack
  File "/app/stable-diffusion-webui/modules/sd_hijack_inpainting.py", line 7, in <module>
    import ldm.models.diffusion.ddpm
  File "/app/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 12, in <module>
    import pytorch_lightning as pl
  File "/opt/venv/lib/python3.10/site-packages/pytorch_lightning/__init__.py", line 34, in <module>
    from pytorch_lightning.callbacks import Callback  # noqa: E402
  File "/opt/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/__init__.py", line 25, in <module>
    from pytorch_lightning.callbacks.progress import ProgressBarBase, RichProgressBar, TQDMProgressBar
  File "/opt/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/progress/__init__.py", line 22, in <module>
    from pytorch_lightning.callbacks.progress.rich_progress import RichProgressBar  # noqa: F401
  File "/opt/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/progress/rich_progress.py", line 20, in <module>
    from torchmetrics.utilities.imports import _compare_version
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/opt/venv/lib/python3.10/site-packages/torchmetrics/utilities/imports.py)
DaemonSnake commented 1 year ago

added the following to the dockerfile

RUN pip install torchmetrics==0.11.4 torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117

works now