mir-group / flare

An open-source Python package for creating fast and accurate interatomic potentials.
https://mir-group.github.io/flare
MIT License
286 stars 68 forks source link

OTF SGP models with force_only=True, not working with OTF.from_checkpint() #376

Open usaleem97 opened 12 months ago

usaleem97 commented 12 months ago

Hi FLARE team,

I am training a SGP potential with force_only tag set to True. If I try resuming training by using the from_checkpoint() method, it spits out the following errors:

Traceback (most recent call last): File "restart.py", line 30, in test_otf= OTF.from_checkpoint('otf_checkpt.json') File "/project/ssharada_53/usaleem/flare/flare/learners/otf.py", line 968, in from_checkpoint otf_model = cls.from_dict(json.loads(f.readline())) File "/project/ssharada_53/usaleem/flare/flare/learners/otf.py", line 920, in from_dict flare_calc, _kernels = SGP_Calculator.from_file(dct["flare_calc"]) File "/project/ssharada_53/usaleem/flare/flare/bffs/sgp/calculator.py", line 164, in from_file sgp, kernels = SGP_Wrapper.from_dict(gp_dict["gp_model"]) File "/project/ssharada_53/usaleem/flare/flare/bffs/sgp/sparse_gp.py", line 295, in from_dict struc_stress = train_struc.stress File "/project/ssharada_53/usaleem/flare/flare/atoms.py", line 102, in stress return self.get_stress() File "/home1/usaleem/.conda/envs/flare/lib/python3.8/site-packages/ase/atoms.py", line 829, in get_stress assert shape == (6,) AssertionError

I did a short OTF SGP trajectory on the same system using force_only=False, and it seemed to work without a problem.

I have attached my run and restart script script.docx script.docx

Thank you in advance! Usama ~

anjohan commented 11 months ago

Hi Usama,

Thank you for your interest in FLARE!

Which version of FLARE are you using?

I don't see the struc_stress = train_struc.stress line anymore, and we fixed some issues related to stress training in #343.

usamaS97 commented 11 months ago

Hi Anders,

Thanks for your response. I am on the 1.4.1 version. And the issue is with the version I am using again.