hello tensorflow

本文详细介绍了在Windows环境下安装TensorFlow的过程,并分享了解决安装过程中遇到的问题的经验。此外,文章还提供了使用Anaconda安装TensorFlow的具体步骤,并推荐了从手写数字识别开始学习的资源。

安装tensorflow

  • 这段时间可能要进深度学习的坑;以前没有弄过,打算从基础的demo学起。

  • 开始学习深度学习的框架tensorflow;由于caffe安装很复杂,然后现在别人说也没有维护了,加之tensorflow现在支持window了;今天就开始安装试试。

  • 网上有很多教程,说白了还是官方的文档给力:Installing TensorFlow on Windows

  • 首先以前的python安装的是2.7的;然后直接又安装了3.5python,当然也安装了 Anacond。

  • 坑啊,自己用其他的python版本,如3.6等都不行,用3.5.3才行

Installing with native pip

If the following version of Python is not installed on your machine, install it now:

Python 3.5.x from python.org
TensorFlow only supports version 3.5.x of Python on Windows. Note that Python 3.5.x comes with the pip3 package manager, which is the program you'll use to install TensorFlow.

To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:

C:\> pip3 install --upgrade tensorflow

Anaconda的方法,所以用spyder就用这种方法

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 
To install the GPU version of TensorFlow, enter the following command (on a single line):

遇到的问题

  • 按网上的教程都是这样写,但是有错;后面改成pip3就可以啦;对了自己还用了天行vpn,不知道有没有影响
>>> pip install tensorflow
SyntaxError: invalid syntax
  • 安装完成如下图:
    864046-20170420172922759-290955845.png

hello tensorflow

  • 直接在spyder上测试错误,没有tensorflow包;原因是Anacond自带的python库路径和tensorflow的实际安装位置不一致。

  • 最后用python3.5自带的shell测试成功,如下图:
    864046-20170420173224962-1732362108.png

后续学习

reference

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值