Skip to content

Commit 1a81455

Browse files
authored
update pip installation method; remove useless troubleshooting
1 parent b05f237 commit 1a81455

File tree

1 file changed

+26
-34
lines changed

1 file changed

+26
-34
lines changed

README.md

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,17 @@ Both CPU and GPU version offline package are avaiable in [the Releases page](htt
111111

112112
## Install the python interface
113113
### 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
115115
```bash
116-
python --version; gcc --version
116+
python --version
117117
```
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.
119118

120119
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`
121120
```bash
122121
virtualenv -p python3 $tensorflow_venv
123122
source $tensorflow_venv/bin/activate
124123
pip install --upgrade pip
125-
pip install --upgrade tensorflow==1.14.0
124+
pip install --upgrade tensorflow==2.1.0
126125
```
127126
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
128127
```bash
@@ -136,31 +135,17 @@ If one has multiple python interpreters named like python3.x, it can be specifie
136135
```bash
137136
virtualenv -p python3.7 $tensorflow_venv
138137
```
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
142-
```
143138
To verify the installation, run
144139
```bash
145-
python -c "import tensorflow as tf; sess=tf.Session(); print(sess.run(tf.reduce_sum(tf.random_normal([1000, 1000]))))"
140+
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
146141
```
147142
One should remember to activate the virtual environment every time he/she uses deepmd-kit.
148143

149144
### Install the DeePMD-kit's python interface
150145

151-
Clone the DeePMD-kit source code
152-
```bash
153-
cd /some/workspace
154-
git clone --recursive https://github.com/deepmodeling/deepmd-kit.git deepmd-kit -b devel
155-
```
156-
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
146+
Execute
162147
```bash
163-
pip install .
148+
pip install deepmd-kit
164149
```
165150
To test the installation, one may execute
166151
```bash
@@ -189,11 +174,30 @@ If one does not need to use DeePMD-kit with Lammps or I-Pi, then the python inte
189174

190175
### Install the Tensorflow's C++ interface
191176

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.
177+
Check the compiler version on your machine
178+
179+
```
180+
gcc --version
181+
```
182+
183+
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.
193184

194185
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.
195186

196187
### Install the DeePMD-kit's C++ interface
188+
189+
Clone the DeePMD-kit source code
190+
```bash
191+
cd /some/workspace
192+
git clone --recursive https://github.com/deepmodeling/deepmd-kit.git deepmd-kit
193+
```
194+
195+
For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
196+
```bash
197+
cd deepmd-kit
198+
deepmd_source_dir=`pwd`
199+
```
200+
197201
Now goto the source code directory of DeePMD-kit and make a build place.
198202
```bash
199203
cd $deepmd_source_dir/source
@@ -606,18 +610,6 @@ rm -r *
606610
```
607611
and redo the `cmake` process.
608612

609-
## Training: TensorFlow abi binary cannot be found when doing training
610-
If you confront such kind of error:
611-
612-
```
613-
$deepmd_root/lib/deepmd/libop_abi.so: undefined symbol:
614-
_ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
615-
```
616-
617-
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-
621613
## MD: cannot run LAMMPS after installing a new version of DeePMD-kit
622614
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.
623615

0 commit comments

Comments
 (0)