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

something wrong when I run this code #21

Open
yanghlll opened this issue Dec 24, 2024 · 2 comments
Open

something wrong when I run this code #21

yanghlll opened this issue Dec 24, 2024 · 2 comments

Comments

@yanghlll
Copy link

yanghlll commented Dec 24, 2024

can anyone plz help me how to fix this error?

INFO:root:Loaded ViT-H-14 model config.
Traceback (most recent call last):
File "/mnt/sda/Video_Generation/FreeNoise/scripts/evaluation/funcs.py", line 239, in load_checkpoint
print(state_dict['module'].keys())
KeyError: 'module'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/mnt/sda/Video_Generation/FreeNoise/scripts/evaluation/inference.py", line 137, in
run_inference(args, gpu_num, rank)
File "/mnt/sda/Video_Generation/FreeNoise/scripts/evaluation/inference.py", line 51, in run_inference
model = load_model_checkpoint(model, args.ckpt_path)
File "/mnt/sda/Video_Generation/FreeNoise/scripts/evaluation/funcs.py", line 248, in load_model_checkpoint
load_checkpoint(model, ckpt, full_strict=False)
File "/mnt/sda/Video_Generation/FreeNoise/scripts/evaluation/funcs.py", line 246, in load_checkpoint
model.load_state_dict(state_dict, strict=full_strict)
File "/home/.conda/envs/freenoise/lib/python3.9/site-packages/torch/nn/modules/module.py", line 2584, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for LatentDiffusion:
size mismatch for scale_arr: copying a param with shape torch.Size([1400]) from checkpoint, the shape in current model is torch.Size([1000]).

if any other details are needed I am happy to share.

@yanghlll yanghlll changed the title someting wrong when I run this something wrong when I run this code Dec 24, 2024
@arthur-qiu
Copy link
Collaborator

I think your checkpoint is not aligned with your config file.

@yanghlll
Copy link
Author

Thank you for your patient response, my problem has been solved.

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

2 participants