Error in loading OCP calculator

I am trying to load a pretrained checkpoint for calculation in ASE

!wget -q -nc https://dl.fbaipublicfiles.com/opencatalystproject/models/2022_09/oc22/s2ef/gnoc_oc22_oc20_all_s2ef.pt

checkpoint_path = "gnoc_oc22_oc20_all_s2ef.pt"
from ocpmodels.common.relaxation.ase_utils import OCPCalculator

ocp_calculator = OCPCalculator(checkpoint=checkpoint_path)

But I am getting this error

TypeError                                 Traceback (most recent call last)
<ipython-input-39-5749a33ccf68> in <cell line: 3>()
      1 from ocpmodels.common.relaxation.ase_utils import OCPCalculator
      2 
----> 3 ocp_calculator = OCPCalculator(checkpoint=checkpoint_path)

TypeError: OCPCalculator.__init__() got an unexpected keyword argument 'checkpoint'

Can anyone please tell how to rectify this error?

Hi!
The attribute name should be “checkpoint_path” instead of checkpoint in the OCPCalculator object like this:

from ocpmodels.common.relaxation.ase_utils import OCPCalculator

ocp_calculator = OCPCalculator(checkpoint_path=checkpoint_path)

Thank you for your answer.
But now a new error has popped up :frowning:

ModuleNotFoundError Traceback (most recent call last)

[<ipython-input-12-a4f8f8f35801>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from ocpmodels.common.relaxation.ase_utils import OCPCalculator 2 ocp_calculator = OCPCalculator(checkpoint_path=checkpoint_path)

---

6 frames
---

[/usr/local/lib/python3.10/dist-packages/torch_geometric/data/dataloader.py](https://localhost:8080/#) in <module> 3 4 from torch_geometric.data import Data, Batch ----> 5 from torch._six import container_abcs, string_classes, int_classes 6 7

ModuleNotFoundError: No module named 'torch._six'

I am running this in Google Colab

Hi -

This seems to be a versioning issue with your dependencies. We hope to make the installation process simpler very shortly. In the meantime, you can visit GitHub - Open-Catalyst-Project/ocp at upgrade-deps and look at the installation instructions here to set up your environment correctly. This will be merged to main soon.

Sorry for the inconvenience!

1 Like