Installing TensorFlow
Procedure
- Use PuTTY to log in to the server as the root user.
- Download the TenforFlow source code.
git clone https://github.com/tensorflow/tensorflow.git
- For the GPU version, you need to install the the CUDA Toolkit by yourself.
- Configure TensorFlow compilation options.
cd tensorflows-xxx ./configure
The configuration for the GPU version is as follows:


- Create a .whl file.
bazel clean –expunge
- The compilation commands for the GPU version are as follows:
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package mkdir tensorflow-pkg bazel-bin/tensorflow/tools/pip_package/build_pip_package --gpu ./tensorflow-pkg
- The generated .whl file is stored in the tensorflow_pkg directory. Run the following command to install it:
pip install tensorflow-xxx.whl
Parent topic: Configuring the Compilation Environment