fast-stable-diffusion: fast_stable_diffusion_AUTOMATIC1111 on google collab getting this error while starting (Start Stable-Diffusion) cell

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 “<frozen importlib._bootstrap>”, line 1050, in _gcd_import File “<frozen importlib._bootstrap>”, line 1027, in _find_and_load File “<frozen importlib._bootstrap>”, line 1006, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 688, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 883, in exec_module File “<frozen importlib._bootstrap>”, line 241, in _call_with_frames_removed File “/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py”, line 83, in <module> from accelerate import version as accelerate_version File “/usr/local/lib/python3.10/dist-packages/accelerate/init.py”, line 7, in <module> from .accelerator import Accelerator File “/usr/local/lib/python3.10/dist-packages/accelerate/accelerator.py”, line 33, in <module> from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers File “/usr/local/lib/python3.10/dist-packages/accelerate/tracking.py”, line 34, in <module> import wandb File “/usr/local/lib/python3.10/dist-packages/wandb/init.py”, line 26, in <module> from wandb import sdk as wandb_sdk File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/init.py”, line 5, in <module> from . import wandb_helper as helper # noqa: F401 File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_helper.py”, line 6, in <module> from .lib import config_util File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/lib/config_util.py”, line 9, in <module> from wandb.util import load_yaml File “/usr/local/lib/python3.10/dist-packages/wandb/util.py”, line 53, in <module> import sentry_sdk # type: ignore File “/usr/local/lib/python3.10/dist-packages/sentry_sdk/init.py”, line 1, in <module> from sentry_sdk.hub import Hub, init File “/usr/local/lib/python3.10/dist-packages/sentry_sdk/hub.py”, line 9, in <module> from sentry_sdk.client import Client File “/usr/local/lib/python3.10/dist-packages/sentry_sdk/client.py”, line 25, in <module> from sentry_sdk.profiler import setup_profiler File “/usr/local/lib/python3.10/dist-packages/sentry_sdk/profiler/init.py”, line 1, in <module> 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 <module> from sentry_sdk.profiler.utils import ( File “/usr/local/lib/python3.10/dist-packages/sentry_sdk/profiler/utils.py”, line 4, in <module> 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 <module> 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 <module> from pytorch_lightning.callbacks import Callback # noqa: E402 File “/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/init.py”, line 14, in <module> from pytorch_lightning.callbacks.callback import Callback File “/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/callback.py”, line 25, in <module> from pytorch_lightning.utilities.types import STEP_OUTPUT File “/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/types.py”, line 28, in <module> from torchmetrics import Metric File “/usr/local/lib/python3.10/dist-packages/torchmetrics/init.py”, line 14, in <module> from torchmetrics import functional # noqa: E402 File “/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/init.py”, line 77, in <module> from torchmetrics.functional.text.bleu import bleu_score File “/usr/local/lib/python3.10/dist-packages/torchmetrics/functional/text/init.py”, line 30, in <module> 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 <module> 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 <module> from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase File “<frozen importlib._bootstrap>”, 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)`

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (1 by maintainers)

Most upvoted comments

fixed, no need to install any package

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: @.***>

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

Why doesn’t the producer fix this problem quickly?

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 —