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
Loading jittable models #41
Comments
running
|
The problem is due to the way PyTorch Geometric constructs jittable modules (https://pytorch-geometric.readthedocs.io/en/latest/notes/jit.html#converting-gnn-models). It dynamically creates the code for the jitted MessagePassing modules at runtime, which causes problems with torch.load() as this requires the classes of the saved model to be accessible. I'm not sure if PyTorch Geometric has some best practice for this problem but torchmd-net implements the This works because pytorch-lightning just stores the state dict and |
I see - this does not work because |
No, currently |
I see. I do not use PTLightning so it looks like I will just have to retrain my models. |
This seems to be a problem of PyTorch Geometric's jit functionalities so it might make sense to ask them how they are planning to load models with the dynamically generated code. |
Yeah - for now I will stick to saving state dictionary and the args. |
I will ask in their discussions forum. |
Thanks for the help! |
The people from PyTorch Geometric currently don't have a solution for this and recommend saving and loading just the state dict as I suggested. Maybe it will work in a future release. See this discussion for details: pyg-team/pytorch_geometric#3075 (comment) |
Thanks - I am currently just saving the state dict as a pickle. |
Hello. After catching up to
main
, I am no longer able to load my models after training them. When callingtorch.load()
on a.pt
file, I get the following error:ModuleNotFoundError: No module named 'CFConvJittable_07e26a'
Is there a new procedure for loading models for prediction/simulation?
The text was updated successfully, but these errors were encountered: