cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils'
Installation successful, error reported after running
ImportError: cannot import name 'SAFE_WEIGHTS_NAME' from 'transformers.utils'
transformers==4.19.2
Try this answer: https://www.reddit.com/r/StableDiffusion/comments/115fmc9/cannot_import_name_safe_weights_name_from/
Edit environments.yaml, "diffusers" --> "diffusers==0.12.1"
Updating the env afterwards via: conda env update -f environment.yaml
I'm installing the project from fresh (though not my first time) and I get this error right off the bat.
It seems init.py in site-packages\transformers\utils_init_.py no longer has the referenced conference of SAFE_WEIGHTS_NAME, seems like it used to be there and isn't now
Aha! Fix found!
pip install diffusers==0.12.1
This project is rife with libraries that don't get installed automatically when they should. If someone would fix that, I think we'd have fewer threads like this
@ClioCJS In my case, I downgraded from diffusers-0.16.1 to 0.12.1, and it solved the import error.
Updating the env afterwards via:
conda env update -f environment.yaml
Would you please be more specific about where to find environment.yaml and what this command does? Also, should we do this in any specific conda environment?
Updating the env afterwards via:
conda env update -f environment.yamlWould you please be more specific about where to find
environment.yamland what this command does? Also, should we do this in any specific conda environment?
the environment.yaml is in stable-diffusion-main and it is used to set up the environment that is then used to execute the program. you can use conda env create -f environment.yaml to create the virtual environment based on the configurations. the environment is then called ldm
diffusers 0.15.0 transformers 4.28.1 Python 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0] :: Anaconda, Inc. on linux torch 1.11.0
it worked on my case.
changing the diffusers version to diffusers==0.12.1 and reinstall works. Looks like the solution is just to specify the version diffusers==0.12.1 in environments.yaml.
Try this answer: https://www.reddit.com/r/StableDiffusion/comments/115fmc9/cannot_import_name_safe_weights_name_from/
Edit environments.yaml, "diffusers" --> "diffusers==0.12.1"
it gives CondaEnvException: Pip failed error...
Im encountering this same error but I am struggling to find a "tutorial" of what to do. For those of us that are not as technical, where are you typing the "pip install diffusers==0.12.1" because when I try to in my command, it just closes after 3 presses.
pip install -U accelerate