一、 建立一个tensorflow环境
Python 2.7
conda create -n tensorflow1 python=2.7
Python 3.4
conda create -n tensorflow1 python=3.4
Python 3.7
conda create -n tensorflow1 python=3.7
使用conda env list 可以检测
二、在新建环境中安装tensorflow
先激活新建的环境,然后,选择pip或者conda安装tensorflow
$ source activate tensorflow1
依据操作系统,Python版本,CPU版本还是CPU+GPU版本,选择合适的语句
Ubuntu/Linux 64-bit, CPU only, Python 2.7
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
Mac OS X, CPU only, Python 2.7:
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py2-none-any.whl
Mac OS X, GPU enabled, Python 2.7:
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0-py2-none-any.whl
Ubuntu/Linux 64-bit, CPU only, Python 3.4
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl
Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp34-cp34m-linux_x86_64.whl
Ubuntu/Linux 64-bit, CPU only, Python 3.5
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl
Ubuntu/Linux 64-bit, GPU enabled, Python 3.5
Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below.
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0-cp35-cp35m-linux_x86_64.whl
Mac OS X, CPU only, Python 3.4 or 3.5:
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
Mac OS X, GPU enabled, Python 3.4 or 3.5:
(tensorflow1)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.10.0-py3-none-any.whl
我安装的命令:export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl
Python 2
(tensorflow1)$ pip install --ignore-installed --upgrade $TF_BINARY_URL
Python 3
(tensorflow1)$ pip3 install --ignore-installed --upgrade $TF_BINARY_URL
用pip install --ignore-installed --upgrade $TF_BINARY_URL
三、检测安装
退出环境
(tensorflow1)$ source deactivate