Closed mbackenkoehler closed 2 years ago
@peastman is this related to #134?
Can you describe how you created the checkpoint? If you can provide your config file, that would be great. Also, was it created with an earlier code version, or with the same version of the code you're using to load it?
It's one of the pretrained checkpoints we provide: https://github.com/torchmd/torchmd-net/tree/main/examples#loading-checkpoints
These were created several months ago with an older version of the code. I think the problem is that we allow multiple prior models now, saved in a ModuleList
. The checkpoints do not contain ModuleList
s for the prior model but instead just the prior model as a Module
. We could probably modify the load_model
function to handle older checkpoints simply by replacing prior_model
by prior_model.0
in the state dict.
That makes sense. I'll try doing it.
can't we just manually modify the checkpoint to be compatible with the new class?
On Wed, Nov 23, 2022 at 10:33 PM Philipp Thölke @.***> wrote:
It's one of the pretrained checkpoints we provide: https://github.com/torchmd/torchmd-net/tree/main/examples#loading-checkpoints
These were created several months ago with an older version of the code. I think the problem is that we allow multiple prior models now, saved in a ModuleList. The checkpoints do not contain ModuleLists for the prior model but instead just the prior model as a Module. We could probably modify the load_model function to handle older checkpoints simply by replacing prior_model by prior_model.0 in the state dict.
— Reply to this email directly, view it on GitHub https://github.com/torchmd/torchmd-net/issues/154#issuecomment-1325682369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3KUOR5O4IZIWBRNJRPF5LWJ2ERLANCNFSM6AAAAAASI5FJ2U . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Yes that would work too.
It just depends whether we care about maintaining backward compatibility with old files or not.
I think it wouldn't hurt to support the older files, especially if we mark the compatibility code as such with a comment.
Trying to load a pre-trained model as described in the
examples
folder results in an error.Code:
Error: