Skip to content

Commit 2470705

Browse files
authored
Merge pull request #157 from njzjz/njzjz-patch-1
update pip installation method; remove useless troubleshooting
2 parents d9800f1 + d3f7cde commit 2470705

File tree

1 file changed

+29
-33
lines changed

1 file changed

+29
-33
lines changed

README.md

Lines changed: 29 additions & 33 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,21 @@ 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
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
142141
```
143142
To verify the installation, run
144143
```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])))"
146145
```
147146
One should remember to activate the virtual environment every time he/she uses deepmd-kit.
148147

149148
### Install the DeePMD-kit's python interface
150149

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
150+
Execute
157151
```bash
158-
cd deepmd-kit
159-
deepmd_source_dir=`pwd`
160-
```
161-
Then execute
162-
```bash
163-
pip install .
152+
pip install deepmd-kit
164153
```
165154
To test the installation, one may execute
166155
```bash
@@ -189,11 +178,30 @@ If one does not need to use DeePMD-kit with Lammps or I-Pi, then the python inte
189178

190179
### Install the Tensorflow's C++ interface
191180

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.
193188

194189
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.
195190

196191
### Install the DeePMD-kit's C++ interface
192+
193+
Clone the DeePMD-kit source code
194+
```bash
195+
cd /some/workspace
196+
git clone --recursive https://github.com/deepmodeling/deepmd-kit.git deepmd-kit
197+
```
198+
199+
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+
197205
Now goto the source code directory of DeePMD-kit and make a build place.
198206
```bash
199207
cd $deepmd_source_dir/source
@@ -613,18 +621,6 @@ rm -r *
613621
```
614622
and redo the `cmake` process.
615623

616-
## Training: TensorFlow abi binary cannot be found when doing training
617-
If you confront such kind of error:
618-
619-
```
620-
$deepmd_root/lib/deepmd/libop_abi.so: undefined symbol:
621-
_ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev
622-
```
623-
624-
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`.
625-
626-
Another possible reason might be the large gap between the python version of TensorFlow and the TensorFlow c++ interface.
627-
628624
## MD: cannot run LAMMPS after installing a new version of DeePMD-kit
629625
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.
630626

0 commit comments

Comments
 (0)