Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions source/lib/include/NNPInter.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class NNPInter
GraphDef graph_def;
bool inited;
template<class VT> 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;
Expand Down Expand Up @@ -210,8 +210,8 @@ class NNPInterModelDevi
vector<GraphDef> graph_defs;
bool inited;
template<class VT> 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;
Expand Down
8 changes: 4 additions & 4 deletions source/lib/src/NNPInter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ init (const string & model, const int & gpu_rank)
ntypes = get_scalar<int>("descrpt_attr/ntypes");
dfparam = get_scalar<int>("fitting_attr/dfparam");
daparam = get_scalar<int>("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;
Expand Down Expand Up @@ -880,8 +880,8 @@ init (const string & model, const int & gpu_rank)
ntypes = get_scalar<int>("descrpt_attr/ntypes");
dfparam = get_scalar<int>("fitting_attr/dfparam");
daparam = get_scalar<int>("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();
Expand Down
7 changes: 4 additions & 3 deletions source/train/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down