NUROISEA/anime-webui-colab

"ModuleNotFoundError"

Closed this issue · 7 comments

Hi, I tried to open the webui today and got this error and I'm not sure how to handle it, I'd be thankful for any help provided :

Launching Web UI with arguments: --opt-sdp-attention --lowram --no-hashing --enable-insecure-extension-access --no-half-vae --disable-safe-unpickle --gradio-queue --ckpt /content/models/hssk.safetensors --ckpt-dir /content/models --vae-dir /content/VAE --vae-path /content/VAE/kl-f8-anime2.ckpt --remotemoe
2024-03-16 23:52:51.712061: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-03-16 23:52:51.712178: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-03-16 23:52:51.843661: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
/usr/local/lib/python3.10/dist-packages/gradio_client/documentation.py:103: UserWarning: Could not get documentation group for <class 'gradio.mix.Parallel'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
/usr/local/lib/python3.10/dist-packages/gradio_client/documentation.py:103: UserWarning: Could not get documentation group for <class 'gradio.mix.Series'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
No module 'xformers'. Proceeding without it.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /content/stable-diffusion-webui/launch.py:38 in │
│ │
│ 35 │
│ 36 │
│ 37 if name == "main": │
│ ❱ 38 │ main() │
│ 39 │
│ │
│ /content/stable-diffusion-webui/launch.py:34 in main │
│ │
│ 31 │ if args.test_server: │
│ 32 │ │ configure_for_tests() │
│ 33 │ │
│ ❱ 34 │ start() │
│ 35 │
│ 36 │
│ 37 if name == "main": │
│ │
│ /content/stable-diffusion-webui/modules/launch_utils.py:340 in start │
│ │
│ 337 │
│ 338 def start(): │
│ 339 │ print(f"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with argum │
│ ❱ 340 │ import webui │
│ 341 │ os.system(f"""sed -i -e "s/dict()))$/dict())).cuda()/gm" /content/stable-diffusion-w │
│ 342 │ if '--nowebui' in sys.argv: │
│ 343 │ │ webui.api_only() │
│ │
│ /content/stable-diffusion-webui/webui.py:49 in │
│ │
│ 46 │ torch.long_version = torch.version
│ 47 │ torch.version = re.search(r'[\d.]+[\d]', torch.version).group(0) │
│ 48 │
│ ❱ 49 from modules import shared, sd_samplers, upscaler, extensions, localization, ui_tempdir, │
│ 50 import modules.codeformer_model as codeformer │
│ 51 import modules.face_restoration │
│ 52 import modules.gfpgan_model as gfpgan │
│ │
│ /content/stable-diffusion-webui/modules/ui_extra_networks.py:7 in │
│ │
│ 4 │
│ 5 from modules import shared │
│ 6 from modules.images import read_info_from_image, save_image_with_geninfo │
│ ❱ 7 from modules.ui import up_down_symbol │
│ 8 import gradio as gr │
│ 9 import json │
│ 10 import html │
│ │
│ /content/stable-diffusion-webui/modules/ui.py:26 in │
│ │
│ 23 │
│ 24 import modules.codeformer_model │
│ 25 import modules.generation_parameters_copypaste as parameters_copypaste │
│ ❱ 26 import modules.gfpgan_model │
│ 27 import modules.hypernetworks.ui │
│ 28 import modules.scripts │
│ 29 import modules.shared as shared │
│ │
│ /content/stable-diffusion-webui/modules/gfpgan_model.py:4 in │
│ │
│ 1 import os │
│ 2 │
│ 3 import facexlib │
│ ❱ 4 import gfpgan │
│ 5 │
│ 6 import modules.face_restoration │
│ 7 from modules import paths, shared, devices, modelloader, errors │
│ │
│ /usr/local/lib/python3.10/dist-packages/gfpgan/init.py:2 in │
│ │
│ 1 # flake8: noqa │
│ ❱ 2 from .archs import * │
│ 3 from .data import * │
│ 4 from .models import * │
│ 5 from .utils import * │
│ │
│ /usr/local/lib/python3.10/dist-packages/gfpgan/archs/init.py:2 in │
│ │
│ 1 import importlib │
│ ❱ 2 from basicsr.utils import scandir │
│ 3 from os import path as osp │
│ 4 │
│ 5 # automatically scan and import arch modules for registry │
│ │
│ /usr/local/lib/python3.10/dist-packages/basicsr/init.py:4 in │
│ │
│ 1 # https://github.com/xinntao/BasicSR
│ 2 # flake8: noqa │
│ 3 from .archs import * │
│ ❱ 4 from .data import * │
│ 5 from .losses import * │
│ 6 from .metrics import * │
│ 7 from .models import * │
│ │
│ /usr/local/lib/python3.10/dist-packages/basicsr/data/init.py:22 in │
│ │
│ 19 data_folder = osp.dirname(osp.abspath(file)) │
│ 20 dataset_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v │
│ 21 # import all the dataset modules │
│ ❱ 22 _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name i │
│ 23 │
│ 24 │
│ 25 def build_dataset(dataset_opt): │
│ │
│ /usr/local/lib/python3.10/dist-packages/basicsr/data/init.py:22 in │
│ │
│ 19 data_folder = osp.dirname(osp.abspath(file)) │
│ 20 dataset_filenames = [osp.splitext(osp.basename(v))[0] for v in scandir(data_folder) if v │
│ 21 # import all the dataset modules │
│ ❱ 22 _dataset_modules = [importlib.import_module(f'basicsr.data.{file_name}') for file_name i │
│ 23 │
│ 24 │
│ 25 def build_dataset(dataset_opt): │
│ │
│ /usr/lib/python3.10/importlib/init.py:126 in import_module │
│ │
│ 123 │ │ │ if character != '.': │
│ 124 │ │ │ │ break │
│ 125 │ │ │ level += 1 │
│ ❱ 126 │ return _bootstrap._gcd_import(name[level:], package, level) │
│ 127 │
│ 128 │
│ 129 _RELOADING = {} │
│ │
│ /usr/local/lib/python3.10/dist-packages/basicsr/data/realesrgan_dataset.py:11 in │
│ │
│ 8 import torch │
│ 9 from torch.utils import data as data │
│ 10 │
│ ❱ 11 from basicsr.data.degradations import circular_lowpass_kernel, random_mixed_kernels │
│ 12 from basicsr.data.transforms import augment │
│ 13 from basicsr.utils import FileClient, get_root_logger, imfrombytes, img2tensor │
│ 14 from basicsr.utils.registry import DATASET_REGISTRY │
│ │
│ /usr/local/lib/python3.10/dist-packages/basicsr/data/degradations.py:8 in │
│ │
│ 5 import torch │
│ 6 from scipy import special │
│ 7 from scipy.stats import multivariate_normal │
│ ❱ 8 from torchvision.transforms.functional_tensor import rgb_to_grayscale │
│ 9 │
│ 10 # -------------------------------------------------------------------- # │
│ 11 # --------------------------- blur kernels --------------------------- # │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

Same problem here

Seems that the error is caused for Google Colab updating its env (again), so I found a solution. Copy and paste the following commands at the end of the notebook, just above the "!phyton launch.py" command; it has worked for my copy of Anything 4.0 notebook:

!pip uninstall torch xformers -y
!python -m pip install torch==2.0.1 torchvision==0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118 xformers==0.0.21

Credits: https://www.patreon.com/posts/for-people-error-100361567?l=es

In life, we all have our heroes, even when we are kids or when we are adults... these people are our inspirations... we will always remember them... even when we'll get old...

My hero, Drakenhof...

Just tested it, this error only happens if you use the "stable" version of the web UI.

Please use the latest version to avoid this. (click here for an image of the version selector)

image

As the stable version's age is showing, I really recommend using latest. Stable is version 1.4 and the latest is 1.8 now, so there's that.

Will test @Drakenhof's suggestion later for people who like stable :)

Pushed an update, feel free to reopen if it breaks again!

(I apologize for reopening, feel free to close again, just justifying myself in case if there's any answer to my particular problem) edit: damn it hasn't reopened, so it's fine I guess
I don't use latest version because I like to use and install lora block weight extension, but it doesn't work there, so I prefer stable owing to this.
Also I get an error trying to use latest version with any tunnel besides cloudfare, it fails to install stable diffusion, even worse when I restart the cell (to install the block weight)
I would like to try latest version but since I'm having these problems it becomes challenging ngl

@Ayaya70 feel free to open a new issue about your problems, and provide all necessary links to all of your extension and other stuff :) (I really encourage you to open a new issue since its easier to track lol)