diff --git a/doc/install.md b/doc/install.md index 5e00d3275a..05a0d3bdb0 100644 --- a/doc/install.md +++ b/doc/install.md @@ -63,7 +63,8 @@ source $tensorflow_venv/bin/activate pip install --upgrade pip pip install --upgrade tensorflow==2.3.0 ``` -It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by +It is highly recommanded to keep the consistency of the TensorFlow version for the python and C++ interfaces. +Everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by ```bash source $tensorflow_venv/bin/activate ``` diff --git a/source/train/Loss.py b/source/train/Loss.py index 1f336325a3..68fd8dd660 100644 --- a/source/train/Loss.py +++ b/source/train/Loss.py @@ -38,11 +38,11 @@ def __init__ (self, jdata, **kwarg) : self.has_ae = (self.start_pref_ae != 0 or self.limit_pref_ae != 0) self.has_pf = (self.start_pref_pf != 0 or self.limit_pref_pf != 0) # data required - add_data_requirement('energy', 1, atomic=False, must=self.has_e, high_prec=True) - add_data_requirement('force', 3, atomic=True, must=self.has_f, high_prec=False) - add_data_requirement('virial', 9, atomic=False, must=self.has_v, high_prec=False) - add_data_requirement('atom_ener', 1, atomic=True, must=self.has_ae, high_prec=False) - add_data_requirement('atom_pref', 1, atomic=True, must=self.has_pf, high_prec=False, repeat=3) + add_data_requirement('energy', 1, atomic=False, must=False, high_prec=True) + add_data_requirement('force', 3, atomic=True, must=False, high_prec=False) + add_data_requirement('virial', 9, atomic=False, must=False, high_prec=False) + add_data_requirement('atom_ener', 1, atomic=True, must=False, high_prec=False) + add_data_requirement('atom_pref', 1, atomic=True, must=False, high_prec=False, repeat=3) def build (self, learning_rate, diff --git a/source/train/argcheck.py b/source/train/argcheck.py index 032d71ad17..c358c114ff 100644 --- a/source/train/argcheck.py +++ b/source/train/argcheck.py @@ -299,6 +299,7 @@ def loss_args(): doc_loss = 'The definition of loss function. The type of the loss depends on the type of the fitting. For fitting type `ener`, the prefactors before energy, force, virial and atomic energy losses may be provided. For fitting type `dipole`, `polar` and `global_polar`, the loss may be an empty `dict` or unset.' ca = Argument('loss', dict, [], [loss_variant_type_args()], + optional = True, doc = doc_loss) return ca