Windows 7 64位安装TenSorFlow
来源:互联网 发布:exe软件重新编译 编辑:程序博客网 时间:2024/05/24 03:52
看着大家都开始搞深度学习,我也开始了新的尝试,最开始Tensorflow只支持Linux和Mac,其实都是Unix系统的,2016年底Tensorflow推出了Windows版本的,我先开始尝试在Linux下面安装,但是很多东西, 最后也没有装好。又尝试Windows下安装,也是很不顺利,装了4天才最终装好了。
我的电脑配置:
系统:Windows7 64位CPU:Intel(R) Core(TM)i5-3470 @3.2GHz安装内存:4G显卡 :AMD Radeon HD 7470
一、安装Python3.5
Windows下安装TensorFlow只支持Python3.5以上的版本,所以安装Python3.5,Python的安装可以从官网下载,Python 3.5 from python.org 或 Python 3.5 from Anaconda 下载并安装Python3.5.0,Anaconda要选择与Python版本配套的。Andconda可以从官网下载,Andconda下载
Python的安装需要设置环境变量,安装教程可以参考Python3.5安装教程。
Winddows7安装Python3.5时会遇到问题,如下图:
这是因为,Windows版本问题,我同样是这个问题,打开360之类的工具,更新系统漏洞,把系统更新到Windows7 SP1版本就可以了。
Python安装完成之后可以在开始菜单里查看。
上面两个一个是IDLE集成开发环境,一个是普通编译器,和CMD在看着一样。
二、修改Pip国内源
安装完Python之后,Python3.x以上版本里面自带有pip,Python3.x以上是pip3,pip下载速度很慢,看着网上各种资料,修改了下pip源。
使用国内镜像加速pip安装,做如下修改:
WIndows 7 在“C:\Users\用户名\AppData\Local\pip”文件夹下,命名为“pip.ini“,添加内容:
[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host=mirrors.aliyun.com
但是Python3.x自带的pip版本较低,需要更新,在cmd中输入指令:
python -m pip install --upgrade pip或者:
pip3 install --upgrade pip
三、安装numpy
打开cmd使用pip进行安装,输入以下指令:
pip3 install numpy
numpy很快就可以安装好。
四、安装TensorFlow
TensorFlow的安装有GPU和CPU两个不同版本,我的GPU不行,所以我安装的是CPU的版本。
采用的输入Shell指令进行安装,
CPU版:
pip3 install tensorflow
CPU版:
pip3 install tensorflow-gpu
安装一会儿就会出现这样的问题,心中无限只草泥马在奔腾,试了N遍总是这样,最终发现,这是网络的问题,pip的速度很慢,所以我采用了下载下来再安装的方法。
TensorFlow下载地址:Tensorflow
然后再进行安装:
pip3 install F:\Program_Files\TenSorFlow\tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
这样很快就可以安装成功:
这时,安装成功之后的TensorFlow的版本是0.12的,所以进行更新:
pip3 install tensorflow
完成之后所有就完成了TensorFlow的安装过程,但是还没有完,这时打开测试TensorFlow的时候还是会错误,输入:
import tensorflow as tf
这时,安装成功之后的TensorFlow的版本是0.12的,所以进行更新:
报错为:
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
解决方法:安装vc_redist.x64.exe,下载地址vc_redist.x64.exe下载地址,安装完成之后就解决了所有问题可以运行TensorFlow了。
五、测试TensorFlow
打开“Python3.5”,输入以下测试程序:
>>> import tensorflow as tf>>> hello = tf.constant('Hello, TensorFlow!')>>> sess = tf.Session()>>> print(sess.run(hello))Hello, TensorFlow!>>> a = tf.constant(10)>>> b = tf.constant(32)>>> print(sess.run(a + b))42>>运行结果:
尝试了一个星期才搞出来,太艰难了!
2 0
- Windows 7 64位安装TenSorFlow
- Windows 7 64位安装TenSorFlow
- Windows 7 64位安装TenSorFlow详细步骤
- Windows 64位下安装TensorFlow
- Windows 10 64位 安装TensorFlow
- 在Windows 7 的64位系统上,安装tensorflow 的CPU版本
- 【TensorFlow】Windows10 64位下安装TensorFlow
- 【TensorFlow】Windows10 64位下安装TensorFlow
- 【TensorFlow】Windows10 64位下安装TensorFlow
- 【TensorFlow】Windows10 64位下安装TensorFlow
- 【TensorFlow】Windows10 64位下安装TensorFlow
- windows 7 安装tensorFlow
- Windows7 64位 安装tensorflow
- Win10 64位安装tensorflow
- Win10 64位安装tensorflow
- Windows7 64位安装TensorFlow
- win7 64位安装tensorflow
- [TensorFlow] windows 安装TensorFlow
- 线程的UncaughtException的用法
- ListView中解决因CheckBox导致的焦点问题
- 分页sql语句
- 算法学习之动态规划(leetcode 62. Unique Paths)
- 2017最新qq第三方登陆教程
- Windows 7 64位安装TenSorFlow
- mongodb(一)-- mongodb简介
- Weka-filter类-选择样本[5]
- Freeswitch配置之sofia
- activemq安装部署发送接收消息
- hdu 5791 Two dp
- 3 Slot PCI Expansion
- Spring基于xml的构造方法注入&setter注入
- Libevent源码分析-----TAILQ_QUEUE队列