From 6946f7fb1467a8d7b62098f476a085d29234eb90 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Thu, 6 Feb 2020 13:08:07 +0800 Subject: [PATCH] fix the bug when the energy has shape () --- dpdata/deepmd/comp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dpdata/deepmd/comp.py b/dpdata/deepmd/comp.py index 5f52c1a0f..ae6fb257a 100644 --- a/dpdata/deepmd/comp.py +++ b/dpdata/deepmd/comp.py @@ -33,6 +33,8 @@ def to_system_data(folder, nframes = np.reshape(cells, [-1,3,3]).shape[0] all_cells.append(np.reshape(cells, [nframes,3,3])) all_coords.append(np.reshape(coords, [nframes,-1,3])) + if eners is not None: + eners = np.reshape(eners, [nframes]) if labels: if eners is not None and len(eners) > 0: all_eners.append(np.reshape(eners, [nframes]))