kyonofx / MDsim

[TMLR 2023] Training and simulating MD with ML force fields
MIT License
103 stars 11 forks source link

Error: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple' #4

Closed liudfgoo closed 1 year ago

liudfgoo commented 1 year ago

Hi everyone, when I used the nequip module in MDsim, I encountered this error:

yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/tuple'
  in "configs/water/nequip/nequip_1k.yml", line 133, column 18

The running command is python main.py --mode train --config-yml configs/water/nequip/nequip_1k.yml. In the nequip_1k.yml file, I found the content below:

133 optimizer_betas: !!python/tuple
134   - 0.9
135   - 0.999

It could be an error caused by this command: !!python/tuple. But I found it's the same way, even though in this file: https://github.com/mir-group/nequip/blob/main/configs/full.yaml.

The version of pyyaml in my python environment is 6.0, satisfying the installation requirements.

I don't know how to solve this problem. Looking forward to your help, thanks!

kyonofx commented 1 year ago

Hi,

since these are just the default values from https://pytorch.org/docs/stable/generated/torch.optim.Adam.html, you can also consider removing the config for optimizer_betas.

liudfgoo commented 1 year ago

Thanks, kyonofx!I have solved this problem. Deleting or commenting away "!!python/tuple" will work.