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

🐛[BUG]: Cannot load model with additional buffers registered #586

Open
simonbyrne opened this issue Jul 11, 2024 · 1 comment
Open

🐛[BUG]: Cannot load model with additional buffers registered #586

simonbyrne opened this issue Jul 11, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@simonbyrne
Copy link
Contributor

Version

0.6.0

On which installation method(s) does this occur?

Docker

Describe the issue

I wanted to include the normalization coefficients in the saved model, so I attached them via

net.register_buffer("norm_coeffs", norm_coeffs)

However when I reload the checkpoint via

net = Module.from_checkpoint(filename)

I get the following error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/modulus/models/module.py", line 363, in from_checkpoint
    model.load_state_dict(model_dict)
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2153, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for EDMPrecond:
        Unexpected key(s) in state_dict: "norm_coeffs". 

Minimum reproducible example

No response

Relevant log output

No response

Environment details

No response

@simonbyrne simonbyrne added ? - Needs Triage Need team to review and classify bug Something isn't working labels Jul 11, 2024
@mnabian
Copy link
Collaborator

mnabian commented Oct 17, 2024

@loliverhennigh could you please take a look at this issue?

@mnabian mnabian removed the ? - Needs Triage Need team to review and classify label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants