Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running convert_original_stable_diffusion_to_diffusers #8

Open
kopyl opened this issue Mar 26, 2023 · 3 comments
Open

Error when running convert_original_stable_diffusion_to_diffusers #8

kopyl opened this issue Mar 26, 2023 · 3 comments

Comments

@kopyl
Copy link

kopyl commented Mar 26, 2023

I run !python ./scripts/convert_original_stable_diffusion_to_diffusers.py --checkpoint_path /content/drive/MyDrive/sd/stable-diffusion-webui/models/Lora/100img_1-5.safetensors --dump_path /content/drive/MyDrive/Stable_diffusion/stable_diffusion_lora_weights/lora-only-100img_1-5 --from_safetensors

And get this error:

/usr/local/lib/python3.9/dist-packages/flax/core/frozen_dict.py:169: FutureWarning: jax.tree_util.register_keypaths is deprecated, and will be removed in a future release. Please use `register_pytree_with_keys()` instead.
  jax.tree_util.register_keypaths(
The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
0it [00:00, ?it/s]
2023-03-26 13:58:12.913301: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
2023-03-26 13:58:12.913397: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
2023-03-26 13:58:12.913418: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
global_step key not found in model
Traceback (most recent call last):
  File "/content/diffusers/./scripts/convert_original_stable_diffusion_to_diffusers.py", line 128, in <module>
    pipe = download_from_original_stable_diffusion_ckpt(
  File "/usr/local/lib/python3.9/dist-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1157, in download_from_original_stable_diffusion_ckpt
    converted_unet_checkpoint = convert_ldm_unet_checkpoint(
  File "/usr/local/lib/python3.9/dist-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 379, in convert_ldm_unet_checkpoint
    new_checkpoint["time_embedding.linear_1.weight"] = unet_state_dict["time_embed.0.weight"]
KeyError: 'time_embed.0.weight'

Last time it was some other error...

@haofanwang
Copy link
Owner

@kopyl What's your 100img_1-5.safetensors? Is it a normal sd model? It seems that diffusers cannot support it not.

@kopyl
Copy link
Author

kopyl commented Mar 27, 2023

@haofanwang it's a LoRA created in kohya_ss GUI (around 10MB)

@pgainullin
Copy link

pgainullin commented Jun 30, 2023

Ok so for me this was just a misunderstanding of what the script does - you actually need a Checkpoint file (typically 2gb+) and not a LoRA (which can be as small as 30Mb).

Alternatively, this is a possibly relevant convo here: MochiDiffusion/MochiDiffusion#261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants