Win10 Theano Install Guide

basic install guide

1. download miniconda

2. conda install libpython mingw

3. conda install theano

now you can run theano correctly.

Enable GPU

1. download and install cuda8.0

2. downlaod and install vs2015

2. download and install Windows Kits

3. add path "LIB" = "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\ucrt\x64"

add path "INCLUDE" = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt";

4. add "C:/user/your_user_name/.theanorc.txt":

 [global]
profile_optimizer=True
profile=True
floatX = float32
device = gpu
[nvcc]
compiler_bindir=D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
8 [dnn]
9 enable=auto

5. theano gpu cpu test:

 from theano import function,config,shared,sandbox
import theano.tensor as T
import numpy
import time
print config.profile vlen=10*30*768
iters=1000
rng=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("loop %d time took "% iters, t1-t0,'seconds')
print("results is",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')
上一篇:MS MDS系列之初始MS Master Data Service(微软主数据服务)


下一篇:bzoj2756