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

Deploying a model #102

Open
sogenyi opened this issue Sep 17, 2024 · 3 comments
Open

Deploying a model #102

sogenyi opened this issue Sep 17, 2024 · 3 comments

Comments

@sogenyi
Copy link

sogenyi commented Sep 17, 2024

Dear friends,

I trained a model earlier with the

model_builders:

  • allegro.model.Allegro

the typical model builders from nequip can still be used:

  • PerSpeciesRescale
  • ForceOutput
  • RescaleEnergyEtc

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:
mir-group/nequip#69 (comment)

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
Copy link
Collaborator

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
Copy link
Author

sogenyi commented Sep 20, 2024

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
Copy link
Author

sogenyi commented Sep 25, 2024

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.

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

2 participants