You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-35Lines changed: 38 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,18 +111,17 @@ Both CPU and GPU version offline package are avaiable in [the Releases page](htt
111
111
112
112
## Install the python interface
113
113
### Install the Tensorflow's python interface
114
-
First, check the python version and compiler version on your machine
114
+
First, check the python version on your machine
115
115
```bash
116
-
python --version; gcc --version
116
+
python --version
117
117
```
118
-
If your python version is 3.7.x, it is highly recommended that the GNU C/C++ compiler is higher than or equal to 5.0.
119
118
120
119
We follow the virtual environment approach to install the tensorflow's Python interface. The full instruction can be found on [the tensorflow's official website](https://www.tensorflow.org/install/pip). Now we assume that the Python interface will be installed to virtual environment directory `$tensorflow_venv`
121
120
```bash
122
121
virtualenv -p python3 $tensorflow_venv
123
122
source$tensorflow_venv/bin/activate
124
123
pip install --upgrade pip
125
-
pip install --upgrade tensorflow==1.14.0
124
+
pip install --upgrade tensorflow==2.1.0
126
125
```
127
126
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
128
127
```bash
@@ -136,31 +135,21 @@ If one has multiple python interpreters named like python3.x, it can be specifie
136
135
```bash
137
136
virtualenv -p python3.7 $tensorflow_venv
138
137
```
139
-
If one needs the GPU support of deepmd-kit, the GPU version of tensorflow should be installed by
140
-
```bash
141
-
pip install --upgrade tensorflow-gpu==1.14.0
138
+
If one does not need the GPU support of deepmd-kit and is concerned about package size, the CPU-only version of tensorflow should be installed by
139
+
```bash
140
+
pip install --upgrade tensorflow-cpu==2.1.0
142
141
```
143
142
To verify the installation, run
144
143
```bash
145
-
python -c "import tensorflow as tf; sess=tf.Session(); print(sess.run(tf.reduce_sum(tf.random_normal([1000, 1000]))))"
144
+
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
146
145
```
147
146
One should remember to activate the virtual environment every time he/she uses deepmd-kit.
If one downloads the .zip file from the github, then the default folder of source code would be `deepmd-kit-master` rather than `deepmd-kit`. For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
157
-
```bash
158
-
cd deepmd-kit
159
-
deepmd_source_dir=`pwd`
160
-
```
161
-
Then execute
150
+
Execute
162
151
```bash
163
-
pip install .
152
+
pip install deepmd-kit
164
153
```
165
154
To test the installation, one may execute
166
155
```bash
@@ -189,11 +178,30 @@ If one does not need to use DeePMD-kit with Lammps or I-Pi, then the python inte
189
178
190
179
### Install the Tensorflow's C++ interface
191
180
192
-
It is highly recommended that one keeps the same C/C++ compiler as the python interface. The C++ interface of DeePMD-kit was tested with compiler gcc >= 4.8. It is noticed that the I-Pi support is only compiled with gcc >= 4.9.
181
+
Check the compiler version on your machine
182
+
183
+
```
184
+
gcc --version
185
+
```
186
+
187
+
The C++ interface of DeePMD-kit was tested with compiler gcc >= 4.8. It is noticed that the I-Pi support is only compiled with gcc >= 4.9.
193
188
194
189
First the C++ interface of Tensorflow should be installed. It is noted that the version of Tensorflow should be in consistent with the python interface. We assume that you have followed our instruction and installed tensorflow python interface 1.14.0 with, then you may follow [the instruction for CPU](doc/install-tf.1.14.md) to install the corresponding C++ interface (CPU only). If one wants GPU supports, he/she should follow [the instruction for GPU](doc/install-tf.1.14-gpu.md) to install the C++ interface.
For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
200
+
```bash
201
+
cd deepmd-kit
202
+
deepmd_source_dir=`pwd`
203
+
```
204
+
197
205
Now goto the source code directory of DeePMD-kit and make a build place.
198
206
```bash
199
207
cd$deepmd_source_dir/source
@@ -437,8 +445,6 @@ positional arguments:
437
445
438
446
optional arguments:
439
447
-h, --help show this help message and exit
440
-
-t INTER_THREADS, --inter-threads INTER_THREADS
441
-
With default value 0. Setting the "inter_op_parallelism_threads" key for the tensorflow, the "intra_op_parallelism_threads" will be set by the env variable OMP_NUM_THREADS
442
448
--init-model INIT_MODEL
443
449
Initialize a model by the provided checkpoint
444
450
--restart RESTART Restart the training from the provided checkpoint
@@ -449,6 +455,15 @@ The keys `intra_op_parallelism_threads` and `inter_op_parallelism_threads` are T
449
455
450
456
**`--restart model.ckpt`**, continues the training from the checkpoint `model.ckpt`.
451
457
458
+
On some resources limited machines, one may want to control the number of threads used by DeePMD-kit. This is achieved by three environmental variables: `OMP_NUM_THREADS`, `TF_INTRA_OP_PARALLELISM_THREADS` and `TF_INTER_OP_PARALLELISM_THREADS`. `OMP_NUM_THREADS` controls the multithreading of DeePMD-kit implemented operations. `TF_INTRA_OP_PARALLELISM_THREADS` and `TF_INTER_OP_PARALLELISM_THREADS` controls `intra_op_parallelism_threads` and `inter_op_parallelism_threads`, which are Tensorflow configurations for multithreading. An explanation is found [here](https://stackoverflow.com/questions/41233635/meaning-of-inter-op-parallelism-threads-and-intra-op-parallelism-threads).
459
+
460
+
For example if you wish to use 3 cores of 2 CPUs on one node, you may set the environmental variables and run DeePMD-kit as follows:
461
+
```bash
462
+
export OMP_NUM_THREADS=6
463
+
export TF_INTRA_OP_PARALLELISM_THREADS=3
464
+
export TF_INTER_OP_PARALLELISM_THREADS=2
465
+
dp train input.json
466
+
```
452
467
453
468
## Freeze a model
454
469
@@ -606,18 +621,6 @@ rm -r *
606
621
```
607
622
and redo the `cmake` process.
608
623
609
-
## Training: TensorFlow abi binary cannot be found when doing training
This may happen if you are using a gcc >= 5.0, and tensorflow was compiled with gcc < 5.0. You may set `-DOP_CXX_ABI=0` in the process of `cmake`.
618
-
619
-
Another possible reason might be the large gap between the python version of TensorFlow and the TensorFlow c++ interface.
620
-
621
624
## MD: cannot run LAMMPS after installing a new version of DeePMD-kit
622
625
This typically happens when you install a new version of DeePMD-kit and copy directly the generated `USER-DEEPMD` to a LAMMPS source code folder and re-install LAMMPS.
0 commit comments