PyNEP icon indicating copy to clipboard operation
PyNEP copied to clipboard

plot_errorvsdistance.py ValueError

Open MES-physics opened this issue 3 years ago • 6 comments

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'

MES-physics avatar Dec 11 '22 16:12 MES-physics

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

bigd4 avatar Dec 12 '22 12:12 bigd4

Here are the first rows.

xxx.txt

MES-physics avatar Dec 12 '22 16:12 MES-physics

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

bigd4 avatar Dec 15 '22 11:12 bigd4

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

MES-physics avatar Dec 15 '22 15:12 MES-physics

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

bigd4 avatar Dec 19 '22 11:12 bigd4

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?

brucefan1983 avatar May 26 '23 17:05 brucefan1983