TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.55k stars 1.31k forks source link

fast_stable_diffusion_AUTOMATIC1111 on google collab getting this error while starting (Start Stable-Diffusion) cell #2934

Closed Katsukipp closed 1 month ago

Katsukipp commented 1 month ago

Screenshot

`Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1146, in _get_module return importlib.import_module("." + module_name, self.name) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 83, in from accelerate import version as accelerate_version File "/usr/local/lib/python3.10/dist-packages/accelerate/init.py", line 7, in from .accelerator import Accelerator File "/usr/local/lib/python3.10/dist-packages/accelerate/accelerator.py", line 33, in from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers File "/usr/local/lib/python3.10/dist-packages/accelerate/tracking.py", line 34, in import wandb File "/usr/local/lib/python3.10/dist-packages/wandb/init.py", line 26, in from wandb import sdk as wandb_sdk File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/init.py", line 5, in from . import wandb_helper as helper # noqa: F401 File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_helper.py", line 6, in from .lib import config_util File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/lib/config_util.py", line 9, in from wandb.util import load_yaml File "/usr/local/lib/python3.10/dist-packages/wandb/util.py", line 53, in import sentry_sdk # type: ignore File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/init.py", line 1, in from sentry_sdk.hub import Hub, init File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/hub.py", line 9, in from sentry_sdk.client import Client File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/client.py", line 25, in from sentry_sdk.profiler import setup_profiler File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/profiler/init.py", line 1, in from sentry_sdk.profiler.continuous_profiler import start_profiler, stop_profiler File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/profiler/continuous_profiler.py", line 12, in from sentry_sdk.profiler.utils import ( File "/usr/local/lib/python3.10/dist-packages/sentry_sdk/profiler/utils.py", line 4, in from sentry_sdk._compat import PY311 ImportError: cannot import name 'PY311' from 'sentry_sdk._compat' (/usr/local/lib/python3.10/dist-packages/sentry_sdk/_compat.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/webui.py", line 13, in initialize.imports() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/initialize.py", line 17, in imports import pytorch_lightning # noqa: F401 File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/init.py", line 34, in from pytorch_lightning.callbacks import Callback # noqa: E402 File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/init.py", line 14, in from pytorch_lightning.callbacks.callback import Callback File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/callback.py", line 25, in from pytorch_lightning.utilities.types import STEP_OUTPUT File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/types.py", line 28, in from torchmetrics import Metric File "/usr/local/lib/python3.10/dist-packages/torchmetrics/init.py", line 14, in from torchmetrics import functional # noqa: E402 File "/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/init.py", line 77, in from torchmetrics.functional.text.bleu import bleu_score File "/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/text/init.py", line 30, in from torchmetrics.functional.text.bert import bert_score # noqa: F401 File "/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/text/bert.py", line 24, in from torchmetrics.functional.text.helper_embedding_metric import ( File "/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/text/helper_embedding_metric.py", line 26, in from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase File "", line 1075, in _handle_fromlist File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1136, in getattr module = self._get_module(self._class_to_module[name]) File "/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py", line 1148, in _get_module raise RuntimeError( RuntimeError: Failed to import transformers.modeling_utils because of the following error (look up to see its traceback): cannot import name 'PY311' from 'sentry_sdk._compat' (/usr/local/lib/python3.10/dist-packages/sentry_sdk/_compat.py)`

danixen2 commented 1 month ago

Same problem >﹏<

PrOCaT20 commented 1 month ago

samee...

Katsukipp commented 1 month ago

as @dvostro said on issues #2933

this code helped :

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

hope author can fixed 'em

rendonj commented 1 month ago

Thanks for the code but one question. In which cell did you insert those lines?

as @dvostro said on issues #2933

this code helped :

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

hope author can fixed 'em

Guroexe commented 1 month ago

Thanks for the code but one question. In which cell did you insert those lines?

as @dvostro said on issues #2933 this code helped : !pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb hope author can fixed 'em

Requirements bro like this:

@markdown # Requirements

print('Installing requirements...')

with capture.capture_output() as cap: %cd /content/ !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/A1111.txt !dpkg -i .deb if not os.path.exists('/content/gdrive/'+mainpth+'/sd/stablediffusion'): !tar -C /content/gdrive/$mainpth --zstd -xf sd_mrep.tar.zst !tar -C / --zstd -xf gcolabdeps.tar.zst !rm .deb | rm .zst | rm .txt if not os.path.exists('gdrive/'+mainpth+'/sd/libtcmalloc/libtcmalloc_minimal.so.4'): %env CXXFLAGS=-std=c++14 !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch %cd /content/gperftools !patch -p1 < /content/Patch !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4 !mkdir -p /content/gdrive/$mainpth/sd/libtcmalloc && cp .libs/libtcmalloc.so /content/gdrive/$mainpth/sd/libtcmalloc %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4 %cd /content !rm *.tar.gz Patch && rm -r /content/gperftools else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121 !pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =\"\"@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

@markdown ---

KyotoLyon commented 1 month ago

I copied and pasted this code, both before the start of stable diffusion, and within requirements and it didn't work.

Has anyone else succeeded?

KyotoLyon commented 1 month ago

Hi, it works for me, i put the lines in requirement:

image

this error appeared:

ControlNet preprocessor location: /content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads 2024-10-19 01:22:12,801 - ControlNet - INFO - ControlNet v1.1.455 01:22:32 - ReActor - STATUS - Running v0.7.1-a1 on Device: CUDA Loading weights [31e35c80fc] from /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors Creating model from config: /content/gdrive/MyDrive/sd/stablediffusion/generative-models/configs/inference/sd_xl_base.yaml creating model quickly: OSError Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_http.py", line 406, in hf_raise_for_status response.raise_for_status() File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/None/resolve/main/config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 403, in cached_file resolved_file = hf_hub_download( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, *kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 862, in hf_hub_download return _hf_hub_download_to_cache_dir( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 969, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1484, in _raise_on_head_call_error raise head_call_error File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1376, in _get_metadata_or_catch_error metadata = get_hf_file_metadata( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 1296, in get_hf_file_metadata r = _request_wrapper( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 277, in _request_wrapper response = _request_wrapper( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py", line 301, in _request_wrapper hf_raise_for_status(response) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_http.py", line 454, in hf_raise_for_status raise _format(RepositoryNotFoundError, message, response) from e huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-67130a8f-4d63981f66483f4c09d87cd9;c9ceee25-45be-44b8-9a9d-dac62c5c723d)

Repository Not Found for url: https://huggingface.co/None/resolve/main/config.json. Please make sure you specified the correct repo_id and repo_type. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 973, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(self._args, self._kwargs) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/initialize.py", line 149, in load_model shared.sd_model # noqa: B018 File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/shared_items.py", line 175, in sd_model return modules.sd_models.model_data.get_sd_model() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_models.py", line 693, in get_sd_model load_model() File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_models.py", line 820, in load_model sd_model = instantiate_from_config(sd_config.model, state_dict) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_models.py", line 775, in instantiate_from_config return constructor(params) File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/models/diffusion.py", line 61, in init self.conditioner = instantiate_from_config( File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/util.py", line 175, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/modules/encoders/modules.py", line 88, in init embedder = instantiate_from_config(embconfig) File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/util.py", line 175, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "/content/gdrive/MyDrive/sd/stablediffusion/generative-models/sgm/modules/encoders/modules.py", line 361, in init self.transformer = CLIPTextModel.from_pretrained(version) File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/sd_disable_initialization.py", line 68, in CLIPTextModel_from_pretrained res = self.CLIPTextModel_from_pretrained(None, model_args, config=pretrained_model_name_or_path, state_dict={}, **kwargs) File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 3301, in from_pretrained resolved_config_file = cached_file( File "/usr/local/lib/python3.10/dist-packages/transformers/utils/hub.py", line 426, in cached_file raise EnvironmentError( OSError: None is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' If this is a private repository, make sure to pass a token having permission to this repo either by logging in with huggingface-cli login or by passing token=<your_token>

Failed to create model quickly; will retry using slow method.

KyotoLyon commented 1 month ago

it worked, it was a damn space in the code

Sanen43 commented 1 month ago

worked. thank you. have a good day.

ghsldsd commented 1 month ago

Even if you copy the entire code as it is, there is no error immediately.

Thanks for the code but one question. In which cell did you insert those lines?

as @dvostro said on issues #2933 this code helped : !pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb hope author can fixed 'em

Requirements bro like this:

@markdown # Requirements

print('�[1;32mInstalling requirements...')

with capture.capture_output() as cap: %cd /content/ !wget -q -i https://raw.githubusercontent.com/TheLastBen/fast-stable-diffusion/main/Dependencies/A1111.txt !dpkg -i .deb if not os.path.exists('/content/gdrive/'+mainpth+'/sd/stablediffusion'): !tar -C /content/gdrive/$mainpth --zstd -xf sd_mrep.tar.zst !tar -C / --zstd -xf gcolabdeps.tar.zst !rm .deb | rm .zst | rm .txt if not os.path.exists('gdrive/'+mainpth+'/sd/libtcmalloc/libtcmalloc_minimal.so.4'): %env CXXFLAGS=-std=c++14 !wget -q https://github.com/gperftools/gperftools/releases/download/gperftools-2.5/gperftools-2.5.tar.gz && tar zxf gperftools-2.5.tar.gz && mv gperftools-2.5 gperftools !wget -q https://github.com/TheLastBen/fast-stable-diffusion/raw/main/AUTOMATIC1111_files/Patch %cd /content/gperftools !patch -p1 < /content/Patch !./configure --enable-minimal --enable-libunwind --enable-frame-pointers --enable-dynamic-sized-delete-support --enable-sized-delete --enable-emergency-malloc; make -j4 !mkdir -p /content/gdrive/$mainpth/sd/libtcmalloc && cp .libs/libtcmalloc.so /content/gdrive/$mainpth/sd/libtcmalloc %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4 %cd /content !rm *.tar.gz Patch && rm -r /content/gperftools else: %env LD_PRELOAD=/content/gdrive/$mainpth/sd/libtcmalloc/libtcmalloc_minimal.so.4

!pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121 !pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

!pip install controlnet_aux -qq --no-deps os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' os.environ['PYTHONWARNINGS'] = 'ignore' !sed -i 's@text = _formatwarnmsg(msg)@text =""@g' /usr/lib/python3.10/warnings.py

clear_output() inf('\u2714 Done','success', '50px')

@markdown ---

ghsldsd commented 1 month ago

I pasted the code as it is, but I get an error. Do I just put the whole thing in?

I copied and pasted this code, both before the start of stable diffusion, and within requirements and it didn't work.

Has anyone else succeeded?

ghsldsd commented 1 month ago

Why doesn't the producer fix this problem quickly?

lucaswalkeryoung commented 1 month ago

It hasn't even been a day my dude. This guy probably has a job.

ghsldsd commented 1 month ago

This problem will be fixed, right?

lucaswalkeryoung commented 1 month ago

Oh yeah. Longest I've ever seen a well used repo like this one go without being fixed is a few days. In truth, I'm a little surprised it hasn't been fixed already. Still, I wouldn't complain. This guy doesn't even ask for donations despite being the best SD notebook out there, used by thousands daily I'm sure.

That said, you might be bumping against the same problem I was - the fix posted at the start of this thread works. You just need to but it lower in the notebook. I created a new cell directly above the "Start Stable-Diffusion" cell and placed the three-line solution in it. Worked like a charm.

ghsldsd commented 1 month ago

Thank you for your response. I'll wait and see. It's the weekend, but I'm just sad I couldn't work on it. What is it like that you made it? I tried entering the above solution, but there was an error and it didn't work.

Katsukipp commented 1 month ago

Thank you for your response. I'll wait and see. It's the weekend, but I'm just sad I couldn't work on it. What is it like that you made it? I tried entering the above solution, but there was an error and it didn't work.

Screenshot (6)

if you still get error, i recommend you to delete all stable difusion folders on your gdrive, do start over and runn the all cell one by one, and before you starting the "Start Stable-Diffusion" cell, just click new cell, and copy paste tis code

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

and after finished, run the "Start Stable-Diffusion" cell and it's gonna works well.

mdlieber99 commented 1 month ago

That fix works perfectly after you delete the extra space. Thanks for sharing.

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

SoumiaSiYoucef commented 1 month ago

That fix works perfectly after you delete the extra space. Thanks for sharing.

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

which space are you referring to?

mdlieber99 commented 1 month ago

In the original post, there was a space before the first command and I think this caused problems for folks. when you paste it in to the requirements as I have it here, it works perfectly

Matthew D. Lieberman, Ph.D. (twitter http://twitter.com/social_brains) Director, UCLA Social Cognitive Neuroscience Laboratory http://www.uclascnlab.com Co-Founder, Resonance Inc. https://www.resonance.info Editor-in-Chief, Social Cognitive and Affective Neuroscience https://academic.oup.com/scan Zoom - https://ucla.zoom.us/my/lieberman

"Being skeptical means demanding evidence, not ignoring it" -Bobby Azarian

"I would rather have questions that can't be answered than answers that can't be questioned" -Richard Feynman

"When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life." -John Lennon

On Sat, Oct 19, 2024 at 9:26 AM SoumiaSiYoucef @.***> wrote:

That fix works perfectly after you delete the extra space. Thanks for sharing.

!pip install --upgrade sentry-sdk !pip install --upgrade transformers !pip install --upgrade wandb

which space are you referring to?

— Reply to this email directly, view it on GitHub https://github.com/TheLastBen/fast-stable-diffusion/issues/2934#issuecomment-2424049576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZG3OPM4DMFS25AZ3GI352DZ4KB3PAVCNFSM6AAAAABQGPTEY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRUGA2DSNJXGY . You are receiving this because you commented.Message ID: @.***>

SoumiaSiYoucef commented 1 month ago

thank you, but i keep getting new errors:

ImportError: cannot import name 'cached_download' from 'huggingface_hub'

ImportError: cannot import name 'DIFFUSERS_SLOW_IMPORT' from 'diffusers.utils' (/usr/local/lib/python3.10/dist-packages/diffusers/utils/init.py)

whenever one is fixed i get a new one

SoumiaSiYoucef commented 1 month ago

" The following values were not passed to accelerate launch and had defaults used instead: --num_processes was set to a value of 1 --num_machines was set to a value of 1 --mixed_precision was set to a value of 'no' --dynamo_backend was set to a value of 'no' To avoid this warning pass in values for each of the problematic parameters or run accelerate config. " another error : /

ghsldsd commented 1 month ago

Thank you very much. Looking at this screen and doing it as it is, it works well!

TheLastBen commented 1 month ago

fixed, no need to install any package

ghsldsd commented 1 month ago

Thank you very much!!!!