Skip to content

Commit 4002aa5

Browse files
authored
Merge pull request #327 from amcadmus/master
Bug fixings and add notice for the consistency of TF versions.
2 parents 15948fa + 2b21c22 commit 4002aa5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

doc/install.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ source $tensorflow_venv/bin/activate
6363
pip install --upgrade pip
6464
pip install --upgrade tensorflow==2.3.0
6565
```
66-
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
66+
It is highly recommanded to keep the consistency of the TensorFlow version for the python and C++ interfaces.
67+
Everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
6768
```bash
6869
source $tensorflow_venv/bin/activate
6970
```

source/train/Loss.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def __init__ (self, jdata, **kwarg) :
3838
self.has_ae = (self.start_pref_ae != 0 or self.limit_pref_ae != 0)
3939
self.has_pf = (self.start_pref_pf != 0 or self.limit_pref_pf != 0)
4040
# data required
41-
add_data_requirement('energy', 1, atomic=False, must=self.has_e, high_prec=True)
42-
add_data_requirement('force', 3, atomic=True, must=self.has_f, high_prec=False)
43-
add_data_requirement('virial', 9, atomic=False, must=self.has_v, high_prec=False)
44-
add_data_requirement('atom_ener', 1, atomic=True, must=self.has_ae, high_prec=False)
45-
add_data_requirement('atom_pref', 1, atomic=True, must=self.has_pf, high_prec=False, repeat=3)
41+
add_data_requirement('energy', 1, atomic=False, must=False, high_prec=True)
42+
add_data_requirement('force', 3, atomic=True, must=False, high_prec=False)
43+
add_data_requirement('virial', 9, atomic=False, must=False, high_prec=False)
44+
add_data_requirement('atom_ener', 1, atomic=True, must=False, high_prec=False)
45+
add_data_requirement('atom_pref', 1, atomic=True, must=False, high_prec=False, repeat=3)
4646

4747
def build (self,
4848
learning_rate,

source/train/argcheck.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ def loss_args():
299299
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.'
300300
ca = Argument('loss', dict, [],
301301
[loss_variant_type_args()],
302+
optional = True,
302303
doc = doc_loss)
303304
return ca
304305

0 commit comments

Comments
 (0)