this error has occurred when I want to initialize SD
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 21, in
from wandb import sdk as wandb_sdk
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/init.py", line 28, in
from .wandb_init import _attach, init
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_init.py", line 39, in
from . import wandb_login, wandb_setup
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_login.py", line 19, in
from .wandb_settings import Settings
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_settings.py", line 25, in
from pydantic import (
ImportError: cannot import name 'computed_field' from 'pydantic' (/usr/local/lib/python3.10/dist-packages/pydantic/init.cpython-310-x86_64-linux-gnu.so)
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
Same problem, it was working fine few hours back...
Seems like a dependency issue.
temporary fix, add this code before "starst stable diffusion"
!pip uninstall wandb
press Y to uninstall
!pip install wandb==0.15.12
it worked, thanks bro
temporary fix, add this code before "starst stable diffusion" !pip uninstall wandb press Y to uninstall
!pip install wandb==0.15.12
Same problem but it was solved with the code that he shared, thank you very much <3
I was also experiencing the same issue and was confused, but uninstalling it using his code solved the problem. Thank you.
一時的な修正として、"starst stable diffusion" の前にこのコードを追加してください 。!pip uninstall wandb アンインストールするには Y を押してください
!pip インストール wandb==0.15.12
あなたのおかげで解決しました!
本当にありがとうございます!!
temporary fix, add this code before "starst stable diffusion" !pip uninstall wandb press Y to uninstall
!pip install wandb==0.15.12
Please tell me where to insert this, I don’t understand. can I get a screenshot?
temporary fix, add this code before "starst stable diffusion" !pip uninstall wandb press Y to uninstall
!pip install wandb==0.15.12
Please tell me where to insert this, I don’t understand. can I get a screenshot?

Go to the bottom of the cells, hover the mouse cursor over the bottom center of the last cell, you will get this "code" button.
Click and add this code -
!pip uninstall wandb
!pip install wandb==0.15.12
Then run the cell before running the "Start Stable Diffusion" cell
I’m curious about why you’re using the computed_field function from version 0.19.x while working with version 0.15.x, instead of using 0.18.x, 0.17.x, or similar versions.
Is it for stability?
I’m asking purely out of curiosity.
!pip install pydantic==1.10.7
!pip install wandb==0.15.5
It seems implementation for Flux...
Sorry.
I am using Google Colab and cannot type “Y”.
What should I do?
!pip install pydantic == 1.10.7 -y
Proceed with installation using the -y option.
!pip install pydantic ==1.10.7 -y
!pip install wandb==0.15.5
Is it OK with you?
!pip uninstall wandb
is not necessary?
!pip install pydantic ==1.10.7 -y !pip install wandb==0.15.5
Is it OK with you?
!pip uninstall wandb
is not necessary?
I've been using
!pip uninstall wandb -y
!pip install wandb==0.15.12
in a cell directly above the Start Stable-Diffusion cell and it's been working for me.
fixed, use the latest notebook