-
Notifications
You must be signed in to change notification settings - Fork 265
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
Unable to initiate OCPCalculator using the eqV2_dens_31M_mp.pt checkpoint #941
Comments
Hi @jinlhr542, Thanks for reporting this! The checkpoint should work with the I will push updated checkpoints that work with the newest version (1.3.0) of FAIRChem too. |
Thank you |
Dear Luis I failed to create the conda environment using the env.cpu.yml file in the omat24 branch: (3.12) jason@YaoshuXiedeMacBook-Pro packages % conda env create -f env.cpu.yml pytorch Preparing transaction: done Pip subprocess error: failed CondaEnvException: Pip failed |
Hi @jinlhr542, Did you run into this issue before? or only when trying to install a version to use the omat24 branch? In any case, I have just pushed checkpoints that are compatible with fairchem-core >= 1.3.0, so there is no need to use the omat24 branch anymore. Could you try re-dowloading the checkpoint and running your original code snippet? |
I have tried to install the current 1.3.0 fairchem-core following the instruction:
I am afraid that there are some errors in the env.cpu.yml. Could you please check it? |
Dear Luis I have successfully installed the 1.3.0 version using a docker container. As you mentioned that 1.3.0 should support eqV2 Dense model, I tried
I have checked the source code of the Then, I used another checkpoint |
Hi @jinlhr542 did you download the checkpoints recently? I uploaded compatible checkpoints earlier this week. I double checked on my end and can load the DeNS checkpoints without issue. |
Python version
3.11
fairchem-core version
1.3.0
pytorch version
2.5.1
cuda version
used cpu
Operating system version
No response
Minimal example
No response
Current behavior
TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 calc = OCPCalculator(checkpoint_path="eqV2_dens_31M_mp.pt", local_cache="pretrained_models", cpu = True)
2 #atoms.calc = calc
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/common/relaxation/ase_utils.py:212, in OCPCalculator.init(self, config_yml, checkpoint_path, model_name, local_cache, trainer, cpu, seed)
209 self.config["checkpoint"] = str(checkpoint_path)
210 del config["dataset"]["src"]
--> 212 self.trainer = registry.get_trainer_class(config["trainer"])(
213 task=config.get("task", {}),
214 model=config["model"],
215 dataset=[config["dataset"]],
216 outputs=config["outputs"],
217 loss_functions=config["loss_functions"],
218 evaluation_metrics=config["evaluation_metrics"],
219 optimizer=config["optim"],
220 identifier="",
221 slurm=config.get("slurm", {}),
222 local_rank=config.get("local_rank", 0),
223 is_debug=config.get("is_debug", True),
224 cpu=cpu,
225 amp=config.get("amp", False),
226 inference_only=True,
227 )
229 if checkpoint_path is not None:
230 self.load_checkpoint(checkpoint_path=checkpoint_path, checkpoint=checkpoint)
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/trainers/ocp_trainer.py:109, in OCPTrainer.init(self, task, model, outputs, dataset, optimizer, loss_functions, evaluation_metrics, identifier, local_rank, timestamp_id, run_dir, is_debug, print_every, seed, logger, amp, cpu, name, slurm, gp_gpus, inference_only)
107 if slurm is None:
108 slurm = {}
--> 109 super().init(
110 task=task,
111 model=model,
112 outputs=outputs,
113 dataset=dataset,
114 optimizer=optimizer,
115 loss_functions=loss_functions,
116 evaluation_metrics=evaluation_metrics,
117 identifier=identifier,
118 local_rank=local_rank,
119 timestamp_id=timestamp_id,
120 run_dir=run_dir,
121 is_debug=is_debug,
122 print_every=print_every,
123 seed=seed,
124 logger=logger,
125 amp=amp,
126 cpu=cpu,
127 slurm=slurm,
128 name=name,
129 gp_gpus=gp_gpus,
130 inference_only=inference_only,
131 )
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/trainers/base_trainer.py:220, in BaseTrainer.init(self, task, model, outputs, dataset, optimizer, loss_functions, evaluation_metrics, identifier, local_rank, timestamp_id, run_dir, is_debug, print_every, seed, logger, amp, cpu, name, slurm, gp_gpus, inference_only)
217 self.primary_metric = None
218 self.ema = None
--> 220 self.load(inference_only)
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/trainers/base_trainer.py:243, in BaseTrainer.load(self, inference_only)
241 self.load_logger()
242 self.load_task()
--> 243 self.load_model()
245 if inference_only is False:
246 self.load_datasets()
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/trainers/base_trainer.py:558, in BaseTrainer.load_model(self)
556 model_config_copy = copy.deepcopy(self.config["model"])
557 model_name = model_config_copy.pop("name")
--> 558 self.model = registry.get_model_class(model_name)(
559 **model_config_copy,
560 ).to(self.device)
562 num_params = sum(p.numel() for p in self.model.parameters())
564 if distutils.is_master():
File /opt/anaconda3/envs/3.11/lib/python3.11/site-packages/fairchem/core/models/base.py:267, in HydraModel.init(self, backbone, heads, finetune_config, otf_graph, pass_through_head_outputs, freeze_backbone)
265 backbone = copy.deepcopy(backbone)
266 backbone_model_name = backbone.pop("model")
--> 267 self.backbone: BackboneInterface = registry.get_model_class(
268 backbone_model_name
269 )(
270 **backbone,
271 )
272 elif starting_model is not None:
273 self.backbone = starting_model.backbone
TypeError: EqV2DeNSBackbone.init() got an unexpected keyword argument 'use_denoising_energy'
Expected Behavior
https://huggingface.co/fairchem/OMAT24 suggests to use fairchem-core 1.2.1 version. However this has been decrepted.
Relevant files to reproduce this bug
No response
The text was updated successfully, but these errors were encountered: