deepmodeling / AIS-Square

GNU Lesser General Public License v3.0
10 stars 8 forks source link

Can't use models from AIS Square #154

Open rschireman opened 1 year ago

rschireman commented 1 year ago

Bug summary

After attempting to use the H2O-DPLR-model in the ASE and LAMMPS (w/ ASE interface), I receive the following error:

RuntimeError: model in graph (version 0.0) is incompatible with the model (version 1.1) supported by the current code.See https://deepmd.rtfd.io/compatability/ for details.

Input Files, Running Commands, Error Log, etc.

ASE input:

from ase import Atoms
from deepmd.calculator import DP

water = Atoms(
    "H2O",
    positions=[(0.7601, 1.9270, 1), (1.9575, 1, 1), (1.0, 1.0, 1.0)],
    cell=[100, 100, 100],
    calculator=DP(model="H2O-SCAN0-model.pb"),
)
print(water.get_potential_energy())
print(water.get_forces())

LAMMPS ASE input:


from ase.calculators.lammpsrun import LAMMPS
from ase import Atoms
water = Atoms(
    "H2O",
    positions=[(0.7601, 1.9270, 1), (1.9575, 1, 1), (1.0, 1.0, 1.0)],
    cell=[100, 100, 100],
)

parameters = {'pair_style': 'deepmd H2O-DPLR-model.pb',
             'pair_coeff':   '* * O H'}                   
files = ['H2O-DPLR-model.pb']
lammps = LAMMPS(parameters=parameters, files=files, keep_tmp_files=True, tmp_dir='./debug')
water.calc = lammps
print(water.get_potential_energy())
wanghan-iapcm commented 1 year ago

As the message explained, the code used to train the model is not compatible to the code you are using to inference the model You may retrain the model with your code to solve the issue