From 3c09d46cad5152d88c2364141bfa6f6abbf12c2c Mon Sep 17 00:00:00 2001 From: zhenyu <76582286+wangzyphysics@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:26:37 +0800 Subject: [PATCH] fix: natom error in calc_model_devi (#3597) #3596 --- deepmd/infer/model_devi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/infer/model_devi.py b/deepmd/infer/model_devi.py index c214e39e92..a37dfd34c5 100644 --- a/deepmd/infer/model_devi.py +++ b/deepmd/infer/model_devi.py @@ -303,7 +303,7 @@ def calc_model_devi( energies = [] forces = [] virials = [] - natom = atype.shape[-1] + natom = np.array(atype).shape[-1] for dp in models: ret = dp.eval( coord,