bigd4 / PyNEP

A python interface of NEP
MIT License
43 stars 18 forks source link

plot_errorvsdistance.py ValueError #14

Open MES-physics opened 1 year ago

MES-physics commented 1 year ago

I also tried this code, plot_errorvsdistance.py, and got this error: Please help. I expect the line with 'forces' will fail next too.

Traceback (most recent call last): File "/home/m/GPUMDcalc/NEPdata/./errorvsdistance.sh", line 26, in train_data = load_nep('train.xyz') File "/home/m/NEP-env/lib/python3.9/site-packages/pynep-0.0.1-py3.9-linux-x86_64.egg/pynep/io.py", line 131, in load_nep n_atoms.append(int(line.split()[0])) ValueError: invalid literal for int() with base 10: 'Lattice="20.0'

bigd4 commented 1 year ago

Can you give the first 10 rows of your train.xyz

MES-physics commented 1 year ago

Here are the first rows.

xxx.txt

bigd4 commented 1 year ago

I am not familiar with the xyz format, maybe @Kick-H can help you.

MES-physics commented 1 year ago

Please also show me your regular exyz format used for this? Thanks

bigd4 commented 1 year ago

The example in https://github.com/brucefan1983/GPUMD/blob/master/examples/nep_potentials/PbTe/train/test.xyz can be red

brucefan1983 commented 1 year ago

Try this

train_data = load_nep("train.xyz", ftype="exyz")

to tell PyNEP that you are loading extended XYZ file instead of our old trian.in (deprecated for GPUMD) file.

@bigd4 Perhaps it is time to completely change to use extended XYZ file, or at least make it as the default?