mir-group / allegro

Allegro is an open-source code for building highly scalable and accurate equivariant deep learning interatomic potentials
https://www.nature.com/articles/s41467-023-36329-y
MIT License
342 stars 45 forks source link

Deploying a model #102

Open sogenyi opened 1 month ago

sogenyi commented 1 month ago

Dear friends,

I trained a model earlier with the

model_builders:

After deploying it for lammps MD simulation i encountered the problem:

Exception: Argument passed to at() was not in the map

I followed the suggestion in this link for a fix: https://github.com/mir-group/nequip/issues/69#issuecomment-1129273665

The new problem i am encountering now is:

Traceback (most recent call last): File "/leonardo/home/userexternal/sogenyi0/NEQUIP1/myenv/bin/nequip-deploy", line 8, in sys.exit(main()) File "/leonardo/home/userexternal/sogenyi0/NEQUIP1/myenv/lib/python3.10/site-packages/nequip/scripts/deploy.py", line 219, in main model = model_from_config(config, deploy=True) File "/leonardo/home/userexternal/sogenyi0/NEQUIP1/myenv/lib/python3.10/site-packages/nequip/model/_build.py", line 96, in model_from_config model = builder(**params) File "/leonardo/home/userexternal/sogenyi0/NEQUIP1/myenv/lib/python3.10/site-packages/allegro/model/_allegro.py", line 32, in Allegro builder_utils.add_avg_num_neighbors( File "/leonardo/home/userexternal/sogenyi0/NEQUIP1/myenv/lib/python3.10/site-packages/nequip/model/builder_utils.py", line 35, in add_avg_num_neighbors raise ValueError("avg_num_neighbors = auto but initialize is False") ValueError: avg_num_neighbors = auto but initialize is False

Please i can anyone help me out?

Linux-cpp-lisp commented 1 month ago

You need StressForceOutput instead of ForceOutput as pair_allegro expects the virial to be computed.

Please check that you are using the latest main branches of nequip and pair_allegro as well.

sogenyi commented 1 month ago

Thank for the response. I have checked

You need StressForceOutput instead of ForceOutput as pair_allegro expects the virial to be computed.

Please check that you are using the latest main branches of nequip and pair_allegro as well.

I am using a latest main branch of nequip and in the config file for the redeployment i effected the necessary changes needed. However, the default_dtype: float32 was used in my training session. An attempt to change it to float64 kept giving error of inconsistency.

sogenyi commented 1 month ago

Hello friends,

I finally had to do fresh installation of most recent versions of the packages and do a retrain this time with right settings in my config yaml file. It worked when i deployed it. Just a tip to all, try to do a test run first with loose parameters and deploy for MD simulation to a certain that your installations is correct.