From 5f770195991ee3cbb5a741e6020b35503aeb3436 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Wed, 22 Jan 2020 10:16:49 +0800 Subject: [PATCH 1/4] fix bug of test data --- source/train/test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/train/test.py b/source/train/test.py index 83f882e32b..47ecaa9128 100755 --- a/source/train/test.py +++ b/source/train/test.py @@ -6,7 +6,6 @@ import argparse import numpy as np -from deepmd.Data import DataSets from deepmd.Data import DeepmdData from deepmd import DeepEval from deepmd import DeepPot @@ -35,13 +34,15 @@ def test_ener (args) : if args.rand_seed is not None : np.random.seed(args.rand_seed % (2**32)) - data = DataSets (args.system, args.set_prefix, shuffle_test = args.shuffle_test) + dp = DeepPot(args.model) + data = DeepmdData(args.system, args.set_prefix, shuffle_test = args.shuffle_test, type_map = dp.get_type_map()) + test_data = data.get_test () numb_test = args.numb_test natoms = len(test_data["type"][0]) nframes = test_data["box"].shape[0] numb_test = min(nframes, numb_test) - dp = DeepPot(args.model) + coord = test_data["coord"][:numb_test].reshape([numb_test, -1]) box = test_data["box"][:numb_test] atype = test_data["type"][0] From 815d716cf5adadab03dea3607aa9b3ad2cca69cd Mon Sep 17 00:00:00 2001 From: Lu Date: Mon, 6 Jan 2020 20:06:49 +0800 Subject: [PATCH 2/4] fix bug of "-l-ldeepmd" --- source/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index d83ffe9e0e..4c43fc9227 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -173,7 +173,7 @@ if (BUILD_CPP_IF) if (USE_CUDA_TOOLKIT) set (LIB_DEEPMD_OP_CUDA "deepmd_op_cuda") else() - set (LIB_DEEPMD_OP_CUDA "") + set (LIB_DEEPMD_OP_CUDA "deepmd_op") endif() if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9) set (LIB_DEEPMD_NATIVE "deepmd_native_md") From 98ec02b0bd3e95e2a8f7c7519e8f9f3da2524a4c Mon Sep 17 00:00:00 2001 From: Han Wang Date: Thu, 23 Jan 2020 07:42:32 +0800 Subject: [PATCH 3/4] fix bug of undefined get_rcut and get_ntypes --- source/lib/include/NNPInter.h | 8 ++++---- source/lib/src/NNPInter.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/lib/include/NNPInter.h b/source/lib/include/NNPInter.h index 20e9bd8aaa..92d0587eea 100644 --- a/source/lib/include/NNPInter.h +++ b/source/lib/include/NNPInter.h @@ -112,8 +112,8 @@ class NNPInter GraphDef graph_def; bool inited; template VT get_scalar(const string & name) const; - VALUETYPE get_rcut () const; - int get_ntypes () const; + // VALUETYPE get_rcut () const; + // int get_ntypes () const; VALUETYPE rcut; VALUETYPE cell_size; int ntypes; @@ -210,8 +210,8 @@ class NNPInterModelDevi vector graph_defs; bool inited; template VT get_scalar(const string name) const; - VALUETYPE get_rcut () const; - int get_ntypes () const; + // VALUETYPE get_rcut () const; + // int get_ntypes () const; VALUETYPE rcut; VALUETYPE cell_size; int ntypes; diff --git a/source/lib/src/NNPInter.cc b/source/lib/src/NNPInter.cc index 47a66893c3..ae72db8487 100644 --- a/source/lib/src/NNPInter.cc +++ b/source/lib/src/NNPInter.cc @@ -849,8 +849,8 @@ init (const string & model, const int & gpu_rank) ntypes = get_scalar("descrpt_attr/ntypes"); dfparam = get_scalar("fitting_attr/dfparam"); daparam = get_scalar("fitting_attr/daparam"); - assert(rcut == get_rcut()); - assert(ntypes == get_ntypes()); + // assert(rcut == get_rcut()); + // assert(ntypes == get_ntypes()); if (dfparam < 0) dfparam = 0; if (daparam < 0) daparam = 0; inited = true; @@ -880,8 +880,8 @@ init (const string & model, const int & gpu_rank) ntypes = get_scalar("descrpt_attr/ntypes"); dfparam = get_scalar("fitting_attr/dfparam"); daparam = get_scalar("fitting_attr/daparam"); - assert(rcut == get_rcut()); - assert(ntypes == get_ntypes()); + // assert(rcut == get_rcut()); + // assert(ntypes == get_ntypes()); if (dfparam < 0) dfparam = 0; if (daparam < 0) daparam = 0; // rcut = get_rcut(); From 3b82e23878ffc281b3e1db5688251c7b3066c65b Mon Sep 17 00:00:00 2001 From: Han Wang Date: Thu, 23 Jan 2020 07:46:21 +0800 Subject: [PATCH 4/4] do not upgrade pip --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 48aa742722..21b69b37ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,7 +72,7 @@ matrix: - CXX=g++-8 - TENSORFLOW_VERSION=2.0 before_install: - - pip install --upgrade pip +# - pip install --upgrade pip - pip install --upgrade setuptools - pip install tensorflow==$TENSORFLOW_VERSION install: