Skip to content

TypeError: forward() got an unexpected keyword argument 'encoder_hidden_states' #2979

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

Closed
HiddenGalaxy opened this issue Apr 5, 2023 · 2 comments

Comments

@HiddenGalaxy
Copy link

Hello developers! Thank you for your contribution! I'm having problems with a github library provided by google (this library is mainly based on huggingface diffusers ): some variable names may be changed in newer versions of diffusers. Therefore, you may encounter some problems with variable names when using third-party libraries, as shown in the following figure.

image

A more detailed example would look like this:
image

However, there is no information about variable name changes in the code, for example in the source code the variable names are still encoder_hidden_states, attention_mask: (the code is in diffusers/src/diffusers/models/attention_processor.py /line 206)
image

I don't understand what the reason for such a problem is, it's a simple variable name problem, I guess it could be caused by the model loaded in DiffusionPipeline.from_pretrained(model_id).to(device) and the model in github not being exactly the same? Or if you can point me to where I can find the correct variable name, I'd appreciate it!

The above is my question, I would be grateful if I could get your answer!

@patrickvonplaten
Copy link
Contributor

Hey @HiddenGalaxy,

Yes for inner / non-public classes such as self.processor we want to keep the right to still do some changes to improve the code. I think for this case, we simply need to update google's prompt-to-prompt code.

A better / more long-term solution would be to add a prompt-to-prompt pipeline directly to diffusers to make sure things are properly maintained.

See: google/prompt-to-prompt#44, #2121

@HiddenGalaxy
Copy link
Author

Thanks! I think my problem has been solved! Thanks again to the developers!

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