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

Exception: expected scalar type Double but found Float #58

Open
duneandre opened this issue Oct 17, 2024 · 2 comments
Open

Exception: expected scalar type Double but found Float #58

duneandre opened this issue Oct 17, 2024 · 2 comments

Comments

@duneandre
Copy link

duneandre commented Oct 17, 2024

Hi,

I have trained a Machine Learning Potential using NequIP version 0.5.6.

Now I want to run MD with this MLP using LAMMPS (version 29 August 2024) and pair_nequip (latest git version). I am running it on another machine on which I have installed NequIP version 0.6.1. (the latest). The calculation did not work and I received the following error :
Exception: expected scalar type Double but found Float

Do you know how to solve this problem?

Thanks for your help !

@fxcoudert
Copy link

I am encountering this issue as well:

  • a model trained and deployed with NequIP version 0.5.6
  • trying to run on LAMMPS with latest pair_nequip from git main branch

I have found and read the previous issue at #51 which seems similar. It states that the problem should be fixed after pull request #52 from @anjohan but I am still seeing the issue with latest git version (which includes this commit).

Is there any configuration that can be tweaked to pair_nequip? Or any advice on how to redeploy the model?

@baham2
Copy link

baham2 commented Feb 3, 2025

Hello, I was wondering if you were able to solve this issue? I am also facing the "Exception: expected scalar type Double but found Float" error, with the following versions: (default_dtype: float64, model_dtype: float32 in config.yaml)
nequip 0.6.0
pair_nequip 0.5.1
lammps stable_29Sep2021_update2

I tried to solve it by converting the pth file into float32 based on #21 (However, using torch.jit as I got a serialization error without it), but I got the following error:
The indicated TorchScript file does not appear to be a deployed NequIP model; did you forget to run nequip-deploy? (src/pair_nequip.cpp:181)

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

3 participants