An error occurred while converting the training model file:KeyError: 'hidden_irreps' #1308
Replies: 2 comments 1 reply
-
|
my training code is here: |
Beta Was this translation helpful? Give feedback.
-
|
hey @why626726-cell , you should not use the model with _compiled in the name, use the file without it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear researchers,
I encountered an error. After completing the training of the MACE model, I wanted to convert the trained model file into a .pt file for use in LAMMPS. When I tried to perform the conversion using the ML-IAP version with the command:python -m mace.cli.create_lammps_model elec_compiled.model --format=mliap
An error occurred:
_/home/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/e3nn/o3/_wigner.py:10: FutureWarning: You are using
torch.loadwithweights_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 forweights_onlywill be flipped toTrue. 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 viatorch.serialization.add_safe_globals. We recommend you start settingweights_only=Truefor 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/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/mace/cli/create_lammps_model.py:79: FutureWarning: You are using
torch.loadwithweights_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 forweights_onlywill be flipped toTrue. 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 viatorch.serialization.add_safe_globals. We recommend you start settingweights_only=Truefor 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(
/home/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/torch/serialization.py:1328: UserWarning: 'torch.load' received a zip file that looks like a TorchScript archive dispatching to 'torch.jit.load' (call 'torch.jit.load' directly to silence this warning)
warnings.warn(
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "/home/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/mace/cli/create_lammps_model.py", line 114, in
main()
File "/home/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/mace/cli/create_lammps_model.py", line 91, in main
model = run_e3nn_to_cueq(copy.deepcopy(model))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/bingxing2/ailab/wanghaoyuan/.conda/envs/para-mace/lib/python3.11/site-packages/mace/cli/convert_e3nn_cueq.py", line 192, in run
num_product_irreps = len(config["hidden_irreps"].slices()) - 1
~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 'hidden_irreps'
However, my training command already included the hidden_irreps parameter. Could anyone please help me figure out the cause of this error? Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions