TensorFlow安装
Windows下的安装
1. Python(仅支持3.5.X)下载:
https://www.python.org/downloads/release/python-352/
2. Anaconda下载
https://repo.continuum.io/archive/index.html (Anaconda3 4.2.0)
3. 在Anaconda prompt下输入
C:>conda create -n tensorflow
4. 激活Anaconda环境
activate tensorflow
5. 安装TensorFlow
CPU: pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
GPU: pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl
本人是Windows10,用这种方法安装出现错误:
(1)Anaconda闪退
(2)TensorFlow测试程序在Anaconda中出错,但是用cmd运行成功
最终解决办法:安装最新版的Anaconda, 改成支持python3.5,具体看下链接,特别简单!!!
http://blog.csdn.net/u012560212/article/details/57409311
Mac下的安装
1. Python(支持2.7、3.4、3.5、3.6)下载:
https://www.python.org/downloads/
2. Anaconda下载
https://repo.continuum.io/archive/index.html (如果python为3.6选最新版本的Anaconda)
3. 在自带终端下(shell)下输入
$ conda create -n tensorflow
4. 激活Anaconda环境
$ source activate tensorflow
(tensorflow)$ # Your prompt should change
5. 安装TensorFlow
(tensorflow)$ pip install --ignore-installed --upgrade $TF_PYTHON_URL
python 2.7
cpu: https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py2-none-any.whl
gpu: https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-1.1.0-py2-none-any.whl
python 3.4 3.5 3.6
cpu: https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py3-none-any.whl
gpu: https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-1.1.0-py3-none-any.whl
Ubuntu下的安装
1. Python(支持2.7、3.4、3.5、3.6)下载:
https://www.python.org/downloads/
2. Anaconda下载
https://repo.continuum.io/archive/index.html (如果python为3.6选最新版本的Anaconda)
3. 在自带终端下(shell)下输入
$ conda create -n tensorflow
4. 激活Anaconda环境
$ source activate tensorflow
(tensorflow)$ # Your prompt should change
5. 安装TensorFlow
(tensorflow)$ pip install --ignore-installed --upgrade $TF_PYTHON_URL
python 2.7
cpu: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-py2-none-any.whl
gpu: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-py2-none-any.whl
python 3.4 3.5 3.6
cpu: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.1.0-py3-none-any.whl
gpu: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-py3-none-any.whl