theano在windows下的安装
来源:互联网 发布:100元的智能手机淘宝 编辑:程序博客网 时间:2024/06/01 10:05
theano安装步骤:
- Python的安装及一系列的包
- Microsoft Visual Studio
- CUDA
- pycuda
- theano
1. Python的安装一及一系列的包
Python建议安装Anaconda,这个打包集成科学计算的包,像什么numpy、scipy等等。
地址:https://www.continuum.io/downloads/
不过国内的下载速度感人,建议上ss。这里我用的是最新的版本
2.Microsoft Visual Studio安装
建议安装vs2013版本的,这里的我安装的是vs2015。安装社区版的就行。
3.CUDA安装
地址:https://developer.nvidia.com/cuda-downloads
注意一定要选对平台,然后傻瓜式安装
4.pycuda安装
我们先要安装
Boost.Python 地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/
这里还要安装pytools,直接用pip安装即可
然后在安装pycuda
地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pycuda
5.theano安装
先用conda安装mingw、libpython
打开cmd使用命令:conda install mingw libpython
等安装完后,使用命令pip install theano
然后在你的user文件下创建.theanorc.txt这个文件。注意前面有个.
[global]floatX = float32device = gpu[nvcc]flags=-LD:/plang/Anaconda3/libscompiler_bindir=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin
这是我的配置文件看着改就行。
然后打开cmd输入Python
看import theano能运行不能
我的出了一个错误:Failed to compile cuda_ndarray.cu: 'utf-8' codec ca
这时候你可以去这个文章上看一看安装python3 keras 出现的错误
然后就可以运行一下这个测试代码看行不行了
from theano import function, config, shared, sandboximport theano.tensor as Timport numpyimport timevlen = 10 * 30 * 768 # 10 x #cores x # threads per coreiters = 1000rng = numpy.random.RandomState(22)x = shared(numpy.asarray(rng.rand(vlen), config.floatX))f = function([], T.exp(x))print(f.maker.fgraph.toposort())t0 = time.time()for i in range(iters): r = f()t1 = time.time()print("Looping %d times took %f seconds" % (iters, t1 - t0))print("Result is %s" % (r,))if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]): print('Used the cpu')else: print('Used the gpu')
如出现这个,恭喜你安装成功了
0 0
- theano在windows下的安装
- theano在windows下安装的若干问题
- Theano 在windows下安装
- windows下安装theano
- windows下安装theano
- windows 下安装theano
- Theano在windows下的正确安装、会出现的问题及解决方法
- windows下theano安装教程
- windows下python3,Theano安装
- 【PTVS+Theano】在windows下使用VS安装theano深度学习工具
- Windows系统下Theano库的安装过程
- Windows下安装Keras和Theano最快速的方法
- Windows7 下安装Theano (Install Theano in Windows 7)
- Anaconda+theano在win7环境下的安装配置
- windows xp 环境下安装theano
- Windows下Theano安装和配置
- 在Windows上安装PyCUDA和Theano
- 在Windows上安装PyCUDA和Theano
- Thread类实现多个客户端连接服务端
- 自定义瀑布流WaterPullLayout
- 基于区块链的融合通信初探(一)
- Dom基本操作
- mootools入门
- theano在windows下的安装
- python操作
- 计算机网络复习
- U-Boot2010.06移植(2440)-----移植网卡DM9000驱动
- 大数运算-模拟
- RPC原理
- java1.8几个漂亮的API设计(2)排序和比较
- 一个c3p0连接数据库时的小问题
- 快速排序纠错