Tensorflow1.0支持Windows系统
Tensorflow1.0用到的Python版本是Py3.5,安装Anaconda时,安装Anaconda3-4.2.0即可,下载地址如下:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.2.0-Windows-x86_64.exe
若出现cmd 不是内部命令或是外部命令的问题,将System32的路径添加进系统变量-Path。
以下是tensorflow官网的安装说明:
Installing with Anaconda
The Anaconda installation is community supported, not officially supported.
Take the following steps to install TensorFlow in an Anaconda environment:
-
Follow the instructions on the Anaconda download site to download and install Anaconda.
-
Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow -
Activate the conda environment by issuing the following command:
C:> activate tensorflow (tensorflow)C:> # Your prompt should change
-
Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl或者(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command (on a single line):
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
-
下载速度慢 使用镜像 pip install --ignore-installed --upgrade tensorflow-gpu -i https://mirrors.aliyun.com/pypi/simple/ 使用一个镜像源,不要混用
-
更新Anaconda,打开CMD,cd D:\Program Files\Anaconda3\Scripts
更新所有库
conda update --all
更新 conda 自身
conda update conda
更新 anaconda 自身
conda update anacond
-
激活 activate tensorflow
-
Validate your installation
Validate your TensorFlow installation by doing the following:
- Start a terminal.
- If you installed through Anaconda, activate your Anaconda environment.
-
Inside that terminal, invoke python:
C:> python -
Enter the following short program inside the python interactive shell:
>>> import tensorflow as tfhello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello))
If the Python program outputs the following, then the installation is successful and you can begin writing TensorFlow programs. (If you are new to TensorFlow, see Getting Started with TensorFlow.)
Hello, TensorFlow!If the system generates an error message instead of a greeting, see the next section.
以上是使用清华的镜像源地址,也可使用下面的镜像地址替换清华源地址:
阿里云
https://mirrors.aliyun.com/pypi/simple/
中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban)
http://pypi.douban.com/simple/
清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/
---------------------
Cannot unpack file问题
pip install --extra-index-url http://mirrors.aliyun.com/pypi/simple/ --upgrade protobuf==3.6.1 --trusted-host mirrors.aliyun.com
ImportError:DLL load failed,找不到指定模块的解决办法
修改protobuf版本
实在不行降低tensorflow版本
python3.6 tensorflow1.11可行
参考
https://blog.csdn.net/jorg_zhao/article/details/80075293