TensorFlow有好多种安装方式,这里我采用了anaconda的方式,是因为这样可以和其他环境互不影响,也不干扰计算机的性能。
(此处我使用的是单位的Fedora27系统,纯属从官网搬运,找起来方便)
- 安装anaconda
- 创建环境:
$ conda create -n tensorflow pip python=2.7 # or python=3.3, etc.
- 激活环境(因为是linux所以有
source
)
$ source activate tensorflow
- 在您的 conda 环境中安装 TensorFlow:
(tensorflow)$ pip install --ignore-installed --upgrade tfBinaryURL
此处的 tfBinaryURL
是 TensorFlow Python 软件包的网址
Python 2.7
仅支持 CPU:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp27-none-linux_x86_64.whl
支持 GPU:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp27-none-linux_x86_64.whl
请注意,GPU 版本需要运行支持 GPU 的 TensorFlow 所需满足的 NVIDIA 要求中所述的 NVIDIA 硬件和软件。
Python 3.4
仅支持 CPU:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp34-cp34m-linux_x86_64.whl
支持 GPU:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp34-cp34m-linux_x86_64.whl
请注意,GPU 版本需要运行支持 GPU 的 TensorFlow 所需满足的 NVIDIA 要求中所述的 NVIDIA 硬件和软件。
Python 3.5
仅支持 CPU:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp35-cp35m-linux_x86_64.whl
支持 GPU:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp35-cp35m-linux_x86_64.whl
请注意,GPU 版本需要运行支持 GPU 的 TensorFlow 所需满足的 NVIDIA 要求中所述的 NVIDIA 硬件和软件。
Python 3.6
仅支持 CPU:
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl
支持 GPU:
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp36-cp36m-linux_x86_64.whl
请注意,GPU 版本需要运行支持 GPU 的 TensorFlow 所需满足的 NVIDIA 要求中所述的 NVIDIA 硬件和软件。