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

Question about Generate with Stability AI codebase #27

Open
ypradhan222 opened this issue Jul 31, 2024 · 6 comments
Open

Question about Generate with Stability AI codebase #27

ypradhan222 opened this issue Jul 31, 2024 · 6 comments

Comments

@ypradhan222
Copy link

Hey author, Great Work but I am bit confused in this generate with Stability AI codebase. As you told to append the lines :
state_dict = torch.load(path/to/ldm/checkpoint_000.pth)['ldm_decoder']
msg = model.first_stage_model.load_state_dict(state_dict, strict=False)
print(f"loaded LDM decoder state_dict with message\n{msg}")
print("you should check that the decoder keys are correctly matched")
I appended it in txt2img file and ran it as
python /working/another.py --prompt "a professional photograph of an astronaut riding a horse" --ckpt /working/v2-1_512-ema-pruned.ckpt --config /working/v2-inference.yaml --H 256 --W 256
but i am getting this error
state_dict = torch.load('output/imgs/checkpoint_000.pth')
loaded LDM decoder state_dict with message
_IncompatibleKeys(missing_keys=['encoder.conv_in.weight', 'encoder.conv_in.bias', 'encoder.down.0.block.0.norm1.weight', 'encoder.down.0.block.0.norm1.bias', 'encoder.down.0.block.0.conv1.weight', 'encoder.down.0.block.0.conv1.bias', 'encoder.down.0.block.0.norm2.weight', 'encoder.down.0.block.0.norm2.bias', 'encoder.down.0.block.0.conv2.weight', 'encoder.down.0.block.0.conv2.bias', 'encoder.down.0.block.1.norm1.weight', 'encoder.down.0.block.1.norm1.bias', 'encoder.down.0.block.1.conv1.weight', 'encoder.down.0.block.1.conv1.bias', 'en.........)
How to fix this ??

@fenghe12
Copy link

have you solved this?

@pierrefdz
Copy link
Contributor

Sorry I just saw the issue. Can you give me the full message (incompatible keys and missing keys)?

@ypradhan222
Copy link
Author

Sure here is the full message ,
(error.txt)
Please correct me if I'm making any mistake in doing. Here is the file which I am executing ,
another.txt

@pierrefdz
Copy link
Contributor

The first part of the error (L1 to L4) are due to the model loading and keys of the ckpts.
You should run state_dict = torch.load(path/to/ldm/checkpoint_000.pth)['ldm_decoder'] as indicated in https://github.com/facebookresearch/stable_signature?tab=readme-ov-file#with-stability-ai-codebase.
Note that is not an error, but a warning meaning that the LDM decoder that you were using was the original one.

The other part is due to problems with the diffuser library. I am not very familiar with it. My guess is that you should try to install a previous version of the library.

@ypradhan222
Copy link
Author

I mended the first part but still the same. Nothing changed.

@ypradhan222
Copy link
Author

I haven't solved it yet can you help me fix

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