anapnoe / stable-diffusion-webui-ux

Stable Diffusion web UI UX
GNU Affero General Public License v3.0
978 stars 59 forks source link

[Bug]: Torch 2.0.0 - Colab #45

Closed NamelessButler closed 1 year ago

NamelessButler commented 1 year ago

Is there an existing issue for this?

What happened?

Google Colab updated it's torch to 2.0.0. It's now throwing errors when starting.

Steps to reproduce the problem

  1. Launch webui

What should have happened?

Start webui normally.

Commit where the problem happens

b8d208fa69efaa4559347c92b55f22ac79fdd1af

What platforms do you use to access the UI ?

Other/Cloud

What browsers do you use to access the UI ?

Opera Gx

Command Line Arguments

--no-half-vae --xformers --enable-insecure-extension-access --no-hashing --lowram --gradio-queue --autolaunch --share

List of extensions

No

Console logs

/content/stable-diffusion-webui
env: LD_PRELOAD=libtcmalloc.so

Python 3.9.16 (main, Dec  7 2022, 01:11:51) 
[GCC 9.4.0]
Commit hash: b8d208fa69efaa4559347c92b55f22ac79fdd1af
Installing gfpgan
Installing clip
Installing open_clip
Installing xformers
Cloning Stable Diffusion into /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...
Cloning Taming Transformers into /content/stable-diffusion-webui/repositories/taming-transformers...
Cloning K-diffusion into /content/stable-diffusion-webui/repositories/k-diffusion...
Cloning CodeFormer into /content/stable-diffusion-webui/repositories/CodeFormer...
Cloning BLIP into /content/stable-diffusion-webui/repositories/BLIP...
Installing requirements for CodeFormer
Installing requirements for Web UI

Installing sd-webui-controlnet requirement: svglib

Launching Web UI with arguments: --no-half-vae --xformers --enable-insecure-extension-access --no-hashing --lowram --gradio-queue --autolaunch --share
2023-04-04 14:02:50.814231: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-04-04 14:02:53.465755: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/content/stable-diffusion-webui/launch.py", line 381, in <module>
    start()
  File "/content/stable-diffusion-webui/launch.py", line 372, in start
    import webui
  File "/content/stable-diffusion-webui/webui.py", line 25, in <module>
    import ldm.modules.encoders.modules
  File "/content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py", line 7, in <module>
    import open_clip
  File "/usr/local/lib/python3.9/dist-packages/open_clip/__init__.py", line 2, in <module>
    from .factory import create_model, create_model_and_transforms, create_model_from_pretrained, get_tokenizer
  File "/usr/local/lib/python3.9/dist-packages/open_clip/factory.py", line 13, in <module>
    from .model import CLIP, CustomTextCLIP, convert_weights_to_lp, convert_to_custom_text_state_dict,\
  File "/usr/local/lib/python3.9/dist-packages/open_clip/model.py", line 17, in <module>
    from .modified_resnet import ModifiedResNet
  File "/usr/local/lib/python3.9/dist-packages/open_clip/modified_resnet.py", line 7, in <module>
    from open_clip.utils import freeze_batch_norm_2d
  File "/usr/local/lib/python3.9/dist-packages/open_clip/utils.py", line 5, in <module>
    from torchvision.ops.misc import FrozenBatchNorm2d
  File "/usr/local/lib/python3.9/dist-packages/torchvision/__init__.py", line 6, in <module>
    from torchvision import datasets, io, models, ops, transforms, utils
  File "/usr/local/lib/python3.9/dist-packages/torchvision/datasets/__init__.py", line 1, in <module>
    from ._optical_flow import FlyingChairs, FlyingThings3D, HD1K, KittiFlow, Sintel
  File "/usr/local/lib/python3.9/dist-packages/torchvision/datasets/_optical_flow.py", line 12, in <module>
    from ..io.image import _read_png_16
  File "/usr/local/lib/python3.9/dist-packages/torchvision/io/__init__.py", line 8, in <module>
    from ._load_gpu_decoder import _HAS_GPU_VIDEO_DECODER
  File "/usr/local/lib/python3.9/dist-packages/torchvision/io/_load_gpu_decoder.py", line 1, in <module>
    from ..extension import _load_library
  File "/usr/local/lib/python3.9/dist-packages/torchvision/extension.py", line 107, in <module>
    _check_cuda_version()
  File "/usr/local/lib/python3.9/dist-packages/torchvision/extension.py", line 80, in _check_cuda_version
    raise RuntimeError(
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.

Additional information

image image

anapnoe commented 1 year ago

check this discussion https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/6932

netrunner-exe commented 1 year ago

Google Colab update has nothing to do with this commit you indicated, the problems of working in Google Colab have little to do with this repository at all. And I was also surprised by the unexpectedly fast colab upgrade to PyTorch 2.0 :)

You can try rolling back PyTorch to a previous version (it is better to do it after installation and error).

!pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.orп/whl/cu117 -U
!pip install torchtext==0.14.1 torchdata==0.5.1

Or run it with arg --reinstall-torch (I haven't tried it personally, but in theory it might help)