Tensorflow-Windows下安装

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:

  1. Follow the instructions on the Anaconda download site to download and install Anaconda.

  2. Create a conda environment named tensorflow by invoking the following command:

    C:> conda create -n tensorflow

     

  3. Activate the conda environment by issuing the following command:

    C:> activate tensorflow (tensorflow)C:> # Your prompt should change

  4. 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           

  5.  下载速度慢 使用镜像 pip install --ignore-installed --upgrade tensorflow-gpu  -i https://mirrors.aliyun.com/pypi/simple/ 使用一个镜像源,不要混用

  6. 更新Anaconda,打开CMD,cd D:\Program Files\Anaconda3\Scripts  
    

    更新所有库

    conda update --all

     

    更新 conda 自身

    conda update conda

    更新 anaconda 自身

    conda update anacond  

  7. 激活 activate tensorflow

  8.  

Validate your installation

Validate your TensorFlow installation by doing the following:

  1. Start a terminal.
  2. If you installed through Anaconda, activate your Anaconda environment.
  3. Inside that terminal, invoke python:

     

     
    C:> python

     

  4. Enter the following short program inside the python interactive shell:

     

     
    >>> import tensorflow as tf

    hello = 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 
 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值