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

How to use OC20 IS2RE Dimnet++ checkpoint #1027

Open
liudean998 opened this issue Feb 23, 2025 · 0 comments
Open

How to use OC20 IS2RE Dimnet++ checkpoint #1027

liudean998 opened this issue Feb 23, 2025 · 0 comments

Comments

@liudean998
Copy link

What would you like to report?

Hello,

I am trying to use the OC20 IS2RE DimeNet++ checkpoint you provided to predict the relaxed adsorption energy of the initial structure. However, it seems that the parameters in the checkpoint do not match the current DimeNet++ parameters.

Here is my code:

import torch
from fairchem.core.models.dimenet_plus_plus import DimeNetPlusPlus

gpu_id = 1
device = torch.device(f"cuda:{gpu_id}" if torch.cuda.is_available() else "cpu")

checkpoint = torch.load('/home/Downloads/dimenetpp_all.pt', map_location=device)
config = checkpoint['config']['model_attributes']

model = DimeNetPlusPlus(
hidden_channels=config["hidden_channels"],
out_channels=config["out_channels"],
num_blocks=config["num_blocks"],
int_emb_size=config["int_emb_size"],
basis_emb_size=config["basis_emb_size"],
out_emb_channels=config["out_emb_channels"],
num_spherical=config["num_spherical"],
num_radial=config["num_radial"],
)

model.load_state_dict(checkpoint['state_dict'])
model.to(device)

model.eval()

However, I encountered the following error:
TypeError: DimeNetPlusPlus.__init__() missing 3 required positional arguments: 'out_channels', 'int_emb_size', and 'basis_emb_size'
How can I resolve this issue?
Alternatively, is there a tutorial for quickly performing inference using the IS2RE checkpoint?

Thank you!

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

1 participant