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

Unable to convert mace_mp_0b2, mace_mp_0b3 models to LAMMPS compatible model #24

Open
avaishali-s opened this issue Jan 24, 2025 · 1 comment

Comments

@avaishali-s
Copy link

I am using the new create_lammps_model.py script to convert the latest pretrained foundation models to LAMMPS model. The script generates the
model-name-lammps.pt file for models available in MACE-MP-0b but for models in MACE-MP-0b2 and MACE-MP-0b3 it does not work.
I am attaching below the command executed and its output

python3 ~/mace/mace/cli/create_lammps_model.py mace-medium-density-agnesi-stress.model
/home/vaishali/.local/lib/python3.8/site-packages/e3nn/o3/_wigner.py:10: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
_Jd, _W3j_flat, _W3j_indices = torch.load(os.path.join(os.path.dirname(file), 'constants.pt'))
/home/vaishali/mace/mace/cli/create_lammps_model.py:66: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
model = torch.load(
Traceback (most recent call last):
File "/home/vaishali/mace/mace/cli/create_lammps_model.py", line 92, in
main()
File "/home/vaishali/mace/mace/cli/create_lammps_model.py", line 66, in main
model = torch.load(
File "/home/vaishali/.local/lib/python3.8/site-packages/torch/serialization.py", line 1097, in load
return _load(
File "/home/vaishali/.local/lib/python3.8/site-packages/torch/serialization.py", line 1525, in _load
result = unpickler.load()
File "/home/vaishali/.local/lib/python3.8/site-packages/torch/serialization.py", line 1515, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'RealAgnosticDensityInteractionBlock' on <module 'mace.modules.blocks' from '/home/vaishali/.local/lib/python3.8/site-packages/mace/modules/blocks.py'>

How can I resolve this issue?

@ilyes319
Copy link
Contributor

Please install the latest mace from source in github, it will solve this issue.

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