deepmodeling / dpgen

The deep potential generator to generate a deep-learning based model of interatomic potential energy and force field
https://docs.deepmodeling.com/projects/dpgen/
GNU Lesser General Public License v3.0
307 stars 175 forks source link

DPGEN with cp2k2022.1[BUG] #1120

Closed cxliangUT closed 1 year ago

cxliangUT commented 1 year ago

Summary

Errors using DPGEN (DPMD+lammps+cp2k) in iteration step 08

DPGEN Version and Platform

DPGEN-0.11.0

Job submission and computing cluster configuration

DPGEN framework in local computer (everything is local, DPMD, lammps as well as CP2K)

Expected Behavior

The DPGEN normally runs

Actual Behavior

the program stops at iteration 00 step 08. The error message shows as:

INFO:dpgen:-------------------------iter.000000 task 08-------------------------- Traceback (most recent call last): File "/workspace/cxliang/conda/envs/deepmd/bin/dpgen", line 8, in sys.exit(main()) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpgen/main.py", line 185, in main args.func(args) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3926, in gen_run run_iter (args.PARAM, args.MACHINE) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3812, in run_iter post_fp (ii, jdata) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3691, in post_fp post_fp_cp2k(iter_index, jdata) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3568, in post_fp_cp2k _sys = dpdata.LabeledSystem(oo, fmt = 'cp2k/output') File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 265, in init self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, convergence_check=convergence_check, kwargs) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 291, in from_fmt return self.from_fmt_obj(load_format(fmt), file_name, kwargs) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 1080, in from_fmt_obj self.check_data() File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 281, in check_data dd.check(self) File "/workspace/cxliang/conda/envs/deepmd/lib/python3.10/site-packages/dpdata/system.py", line 121, in check raise DataError("Shape of %s is %s, but expected %s" % (self.name, dpdata.system.DataError: Shape of forces is (1, 5, 3), but expected (1, 4, 3)

Steps to Reproduce

just try DPGEN (DPMD-kit2.1.5+lammps+cp2k2022.1)

Further Information, Files, and Links

image dpgen_example_cp2k.zip

Interesting Findings the cases we are working on is nothing but the methane cases in example. we find that the problem comes from the dpdata in dpgen, when the dpdata reads the output file from cp2k, it will miss the coordinate of the first hydrogen atom. Then, the frames, number of atoms ,etc are obtained from the coordinates file, which gives the wrong information. We find that dpdata is accurate to read in the forces.

njzjz commented 1 year ago

@robinzyb How about submitting a PR to migrate to the format in your cp2kdata package?

robinzyb commented 1 year ago

@robinzyb How about submitting a PR to migrate to the format in your cp2kdata package?

any suggestion? Specifically, I used a different format name, "cp2kdata/xx," instead of the original "cp2k/aimd." A simple solution is to replace the format name.

njzjz commented 1 year ago

A simple solution is to replace the format name.

This looks good to me.

njzjz commented 1 year ago

Fixed by https://github.com/deepmodeling/dpdata/pull/533.