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

ocpmodels unavailable? #19

Open
njszym opened this issue May 25, 2024 · 6 comments
Open

ocpmodels unavailable? #19

njszym opened this issue May 25, 2024 · 6 comments

Comments

@njszym
Copy link

njszym commented May 25, 2024

In the README file for this repository, it points to FAIR-Chem for the installation of ocpmodels. However, that package does not seem to exist in the FAIR-Chem repository. Is this deprecated, and if so, is there a replacement for ocpmodels that could be used to run the charge density prediction models?

@emsunshine
Copy link
Collaborator

Hello, you are correct that the repository has been renamed to FAIR-chem. The ocpmodels package can now be found at fairchem.core. I will update this repository accordingly

@arupmondal835
Copy link

Hello,
I am having the same issue. I have successfully installed the fairchem.core package through pip. But still getting the ocpmodels error.
ModuleNotFoundError: No module named 'ocpmodels'
Could you help me with some detailed guidance?
Thank you,

@arupmondal835
Copy link

After some exploration I realized ocpmodels should be replaced with fairchem.core in the code. Is that right? Also, I am not able to find the base model from the base.py. Should it be renamed as well?

Traceback (most recent call last):
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/x.py", line 22, in
import cdm.models
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/cdm/init.py", line 1, in
from .models import *
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/cdm/models/init.py", line 2, in
from .gemnet_charge import GemNetT_charge
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/cdm/models/gemnet_charge.py", line 21, in
from fairchem.core.models.base import BaseModel
ImportError: cannot import name 'BaseModel' from 'fairchem.core.models.base' (/projects/gt47/amondal2/Source/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/fairchem/core/models/base.py)

@emsunshine
Copy link
Collaborator

You can probably get rid of the BaseModel import in gemnet_charge.py. I don't think it's actually used in the file.

If you manage to get the repository working with the current fairchem repository feel free to submit a PR!

@arupmondal835
Copy link

Thanks! Yes, that's what I did. However there are several other attributes that the code is importing but fairchem does not have them. such as:

_Jd = torch.load(os.path.join(os.path.dirname(file), "Jd.pt"))
Traceback (most recent call last):
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/x.py", line 23, in
import cdm.models
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/cdm/init.py", line 2, in
from .charge_trainer import ChargeTrainer
File "/kfs2/projects/gt47/amondal2/property_charge_density-models/cdm/charge_trainer.py", line 21, in
from fairchem.core.common.data_parallel import (
ImportError: cannot import name 'OCPDataParallel' from 'fairchem.core.common.data_parallel' (/projects/gt47/amondal2/Source/colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/fairchem/core/common/data_parallel.py)

I think I can not get rid of OCPDataParallel as this is being used in the code. Do you know how to fix it?

Thanks

@emsunshine
Copy link
Collaborator

I guess torch's DistributedDataParallel might work, following the changes that were made here: https://github.com/FAIR-Chem/fairchem/blob/e11e78e87f791241b3759a7218a1b0e307a49662/src/fairchem/core/trainers/base_trainer.py#L578

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

3 participants