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

Getting error got an unexpected keyword argument 'checkpoint_path' #5374

Closed
LemonsRobert opened this issue Oct 12, 2023 · 5 comments
Closed
Labels
bug Something isn't working stale Issues that haven't received updates

Comments

@LemonsRobert
Copy link

LemonsRobert commented Oct 12, 2023

Describe the bug

I been trying to convert .safetenor to .diffusers in Colab. After running .py file getting error as
got an unexpected keyword argument 'checkpoint_path'

Reproduction

Traceback (most recent call last):
File "/content/diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py", line 130, in
pipe = download_from_original_stable_diffusion_ckpt(
TypeError: download_from_original_stable_diffusion_ckpt() got an unexpected keyword argument 'checkpoint_path'

Logs

No response

System Info

latest versions of diffusers, transformers, omegaconf on Google colab

Who can help?

@patrickvonplaten @sayakpaul or @anyone

@LemonsRobert LemonsRobert added the bug Something isn't working label Oct 12, 2023
@LemonsRobert
Copy link
Author

@DN6
Copy link
Collaborator

DN6 commented Oct 12, 2023

@LemonsRobert When I tried running your notebook I get the following error. I think you need to download the yaml file as well for the model in the notebook.

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-10-12 12:30:24.700908: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/content/diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py", line 160, in <module>
    pipe = download_from_original_stable_diffusion_ckpt(
  File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1291, in download_from_original_stable_diffusion_ckpt
    original_config = OmegaConf.load(original_config_file)
  File "/usr/local/lib/python3.10/dist-packages/omegaconf/omegaconf.py", line 189, in load
    with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/content/diffusers/v1-inpainting-inference.yaml'

@LemonsRobert
Copy link
Author

LemonsRobert commented Oct 12, 2023

Hey @DN6 Thanks for the reply,

I am new to this. So idk how to get yaml file for the model? Can you guide me !

Edit:

Somehow I got yaml file I dont know it is working or not here is the file
v1-inpainting-inference.yaml.txt

After using the above file I am getting this error now, idk error based on yaml file or code or model, can you check?

2023-10-12 14:10:59.409475: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/content/diffusers/scripts/convert_original_stable_diffusion_to_diffusers.py", line 160, in <module>
    pipe = download_from_original_stable_diffusion_ckpt(
  File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py", line 1411, in download_from_original_stable_diffusion_ckpt
    unet.load_state_dict(converted_unet_checkpoint)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for UNet2DConditionModel:
	size mismatch for conv_in.weight: copying a param with shape torch.Size([320, 9, 3, 3]) from checkpoint, the shape in current model is torch.Size([320, 4, 3, 3]).

If you didn't get above error I already saved it in colab notebook.

@DN6
Copy link
Collaborator

DN6 commented Oct 17, 2023

There is a mismatch is the UNet channels in your checkpoint and the configuration file being used. Can you verify if the checkpoint you're downloading for inpainting is the right one?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that haven't received updates
Projects
None yet
Development

No branches or pull requests

2 participants