You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was using painn_h1024_bs4x8_is2re_all.pt to execute the initial structure to relaxed energy prediction, and I got the following errors: (which did not appear in S2EF models)
from fairchem.core.common.relaxation.ase_utils import OCPCalculator
from ase.io import read
from ase.io import write
import matplotlib.pyplot as plt
from ase.visualize.plot import plot_atoms
from io import StringIO
import contextlib
import os
import numpy as np
import sys
local_model_dir='/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/examples/fairchem_checkpoints/'
model='painn_h1024_bs4x8_is2re_all.pt'
id='90614'
system = read(f'vasp_files/combine-{id}.vasp')
write('initial_structure.vasp', system)
system.set_tags(np.ones(len(system))) #only when use gemnet
checkpoint_path = os.path.join(local_model_dir,model)
with contextlib.redirect_stdout(StringIO()) as _:
calc = OCPCalculator(checkpoint_path=checkpoint_path, cpu=False)
system.set_calculator(calc)
E_slab_adsorbate = system.get_potential_energy()
print(E_slab_adsorbate)
Here is my Error
INFO:root:Loading model: painn
/home/bingxing2/home/scx8jte/.conda/envs/fair-chem/lib/python3.9/site-packages/torch_geometric/nn/conv/message_passing.py:988: UserWarning: 'PaiNNMessage.jittable' is deprecated and a no-op. Please remove its usage.
warnings.warn(f"'{self.class.name}.jittable' is deprecated "
INFO:root:Loaded PaiNN with 72255495 parameters.
INFO:root:Loading checkpoint in inference-only mode, not loading keys associated with trainer state!
INFO:root:Overwriting scaling factors with those loaded from checkpoint. If you're generating predictions with a pretrained checkpoint, this is the correct behavior. To disable this, delete scale_dict from the checkpoint.
/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/fairchem/packages/fairchem-core/src/fairchem/core/modules/normalization/normalizer.py:69: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
"mean": torch.tensor(state_dict["mean"]),
WARNING:root:No seed has been set in modelcheckpoint or OCPCalculator! Results may not be reproducible on re-run
/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/examples/combined_system_IS2RE_2.py:49: DeprecationWarning: Please use atoms.calc = calc
system.set_calculator(calc)
/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/fairchem/packages/fairchem-core/src/fairchem/core/trainers/ocp_trainer.py:461: FutureWarning: torch.cuda.amp.autocast(args...) is deprecated. Please use torch.amp.autocast('cuda', args...) instead.
with torch.cuda.amp.autocast(enabled=self.scaler is not None):
Traceback (most recent call last):
File "/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/examples/combined_system_IS2RE_2.py", line 51, in
E_slab_adsorbate = system.get_potential_energy()
File "/home/bingxing2/home/scx8jte/.conda/envs/fair-chem/lib/python3.9/site-packages/ase/atoms.py", line 755, in get_potential_energy
energy = self._calc.get_potential_energy(self)
File "/home/bingxing2/home/scx8jte/.conda/envs/fair-chem/lib/python3.9/site-packages/ase/calculators/abc.py", line 24, in get_potential_energy
return self.get_property(name, atoms)
File "/home/bingxing2/home/scx8jte/.conda/envs/fair-chem/lib/python3.9/site-packages/ase/calculators/calculator.py", line 538, in get_property
self.calculate(atoms, [name], system_changes)
File "/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/fairchem/packages/fairchem-core/src/fairchem/core/common/relaxation/ase_utils.py", line 233, in calculate
predictions = self.trainer.predict(batch, per_image=False, disable_tqdm=True)
File "/home/bingxing2/home/scx8jte/.conda/envs/fair-chem/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/fairchem/packages/fairchem-core/src/fairchem/core/trainers/ocp_trainer.py", line 462, in predict
out = self._forward(batch)
File "/home/bingxing2/home/scx8jte/ai4s/fairchem_benchmark/fairchem/packages/fairchem-core/src/fairchem/core/trainers/ocp_trainer.py", line 293, in _forward
raise AttributeError(
AttributeError: Output target: 'forces', not found in model outputs: ['energy']
The text was updated successfully, but these errors were encountered:
Hi, I was using painn_h1024_bs4x8_is2re_all.pt to execute the initial structure to relaxed energy prediction, and I got the following errors: (which did not appear in S2EF models)
Here is my Error
The text was updated successfully, but these errors were encountered: