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
-[Install the python interaction](#install-the-python-interface)
17
17
-[Install the Tensorflow's python interface](#install-the-tensorflows-python-interface)
18
18
-[Install the DeePMD-kit's python interface](#install-the-deepmd-kits-python-interface)
@@ -90,8 +90,10 @@ Please follow our [github](https://github.com/deepmodeling/deepmd-kit) webpage t
90
90
## Easy installation methods
91
91
There various easy methods to install DeePMD-kit. Choose one that you prefer. If you want to build by yourself, jump to the next two sections.
92
92
93
-
### With Docker
94
-
A docker for installing the DeePMD-kit on CentOS 7 is available [here](https://github.com/frankhan91/deepmd-kit_docker).
93
+
After your easy installation, DeePMD-kit (`dp`) and LAMMPS (`lmp`) will be available to execute. You can try `dp -h` and `lmp -h` to see the help. `mpirun` is also available considering you may want to run LAMMPS in parallel.
94
+
95
+
### Offline packages
96
+
Both CPU and GPU version offline packages are avaiable in [the Releases page](https://github.com/deepmodeling/deepmd-kit/releases).
95
97
96
98
### With conda
97
99
DeePMD-kit is avaiable with [conda](https://github.com/conda/conda). Install [Anaconda](https://www.anaconda.com/distribution/#download-section) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html) first.
To install the GPU version containing [CUDA 10.0](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver):
106
+
To install the GPU version containing [CUDA 10.1](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver):
First, check the python version and compiler version on your machine
126
+
First, check the python version on your machine
115
127
```bash
116
-
python --version; gcc --version
128
+
python --version
117
129
```
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
130
120
131
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
132
```bash
122
133
virtualenv -p python3 $tensorflow_venv
123
134
source$tensorflow_venv/bin/activate
124
135
pip install --upgrade pip
125
-
pip install --upgrade tensorflow==1.14.0
136
+
pip install --upgrade tensorflow==2.1.0
126
137
```
127
138
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
139
```bash
@@ -136,31 +147,21 @@ If one has multiple python interpreters named like python3.x, it can be specifie
136
147
```bash
137
148
virtualenv -p python3.7 $tensorflow_venv
138
149
```
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
150
+
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
151
+
```bash
152
+
pip install --upgrade tensorflow-cpu==2.1.0
142
153
```
143
154
To verify the installation, run
144
155
```bash
145
-
python -c "import tensorflow as tf; sess=tf.Session(); print(sess.run(tf.reduce_sum(tf.random_normal([1000, 1000]))))"
156
+
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
146
157
```
147
158
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
162
-
```bash
163
-
pip install .
164
+
pip install deepmd-kit
164
165
```
165
166
To test the installation, one may execute
166
167
```bash
@@ -189,11 +190,30 @@ If one does not need to use DeePMD-kit with Lammps or I-Pi, then the python inte
189
190
190
191
### Install the Tensorflow's C++ interface
191
192
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.
193
+
Check the compiler version on your machine
194
+
195
+
```
196
+
gcc --version
197
+
```
198
+
199
+
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
200
194
201
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
212
+
```bash
213
+
cd deepmd-kit
214
+
deepmd_source_dir=`pwd`
215
+
```
216
+
197
217
Now goto the source code directory of DeePMD-kit and make a build place.
198
218
```bash
199
219
cd$deepmd_source_dir/source
@@ -437,8 +457,6 @@ positional arguments:
437
457
438
458
optional arguments:
439
459
-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
460
--init-model INIT_MODEL
443
461
Initialize a model by the provided checkpoint
444
462
--restart RESTART Restart the training from the provided checkpoint
@@ -449,6 +467,15 @@ The keys `intra_op_parallelism_threads` and `inter_op_parallelism_threads` are T
449
467
450
468
**`--restart model.ckpt`**, continues the training from the checkpoint `model.ckpt`.
451
469
470
+
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).
471
+
472
+
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:
473
+
```bash
474
+
export OMP_NUM_THREADS=6
475
+
export TF_INTRA_OP_PARALLELISM_THREADS=3
476
+
export TF_INTER_OP_PARALLELISM_THREADS=2
477
+
dp train input.json
478
+
```
452
479
453
480
## Freeze a model
454
481
@@ -606,18 +633,6 @@ rm -r *
606
633
```
607
634
and redo the `cmake` process.
608
635
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
636
## MD: cannot run LAMMPS after installing a new version of DeePMD-kit
622
637
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