mir-group / flare

An open-source Python package for creating fast and accurate interatomic potentials.

Home Page:https://mir-group.github.io/flare

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: __class__ assignment: 'FLARE_Atoms' object layout differs from 'Atom'

lenardcarroll opened this issue · comments

Hi there, I am trying to use FLARE for Training a Gaussian Process from an AIMD Run. Here is an example of what I am trying to do so far https://colab.research.google.com/drive/16OBMTFhnPJBR54Ge9HBOA9KYUK9rYi9e?usp=sharing

I have read in my test .xyz file which consists of 3 frames, but I ultimately get the error of:
"TypeError: class assignment: 'FLARE_Atoms' object layout differs from 'Atom'"

Not sure how to fix this or how to go forward with it. Some help would be appreciated.

Hi Lenard,

I think ase.io.read will only read the last frame by default, so you need to give it index=":". Your code reads only one frame and tries to iterate over the atoms in it, rather than iterate over the three frames in the trajectory.

Btw: We are in the process of integrating the many-body version of FLARE, which you may want to check out on the development branch ;-) While the old 2+3-body code will remain available, we generally find that the new code is a direct upgrade (faster training, better accuracy, similar or better MD speed).

Hi @lenardcarroll, the issue is probably because in the development branch we removed the Structure class, which is used by TrajectoryTrainer and has the attribute indices_of_specie. To test the training from AIMD trajectory from our latest code, you can take a look at the offline training tutorial.