服务器安装(九):theano

继王同学伸出援手之后,我以为我终于脱离苦海了,但跑我人生中第三个model的时候,问题来了....

theano orz 跪了 

1)先看看服务器版本号


2)再看看安装列表


python2.7下采用 conda install 安装的版本为0.9

原来安装完还需要配置环境:

centos下python2.7下安装theano使用gpu报错:can not use cuDNN on context None:。。。致命错误:cudnn.h

ubuntu14.04安装深度学习Theano框架及错误解决


————————————

命令: vim ~/.theanorc

更改完: “ESC”+":"   然后输出 "wq"保存后退出

我目前的环境:

(仅供参考)

[global]

device = cuda

floatX = float32

force_device = True

optimizer=fast_compile

optimizer_including=cudnn # if you have successfully installed cudnn, otherwise remove it

[lib]

cnmem=0.8

[blas]

ldflas=-lopenblas

[nvcc]

fastmath=True

flags=-D_FORCE_INLINES

# if your nvidia card is too recent but cuda-toolkit is older, for example gtx1060 and cuda7.5, you have to set this.

[cuda]

root=/usr/local/cuda/

[dnn]

enabled =  True

include_path=/usr/local/cuda/include

include_including = /usr/local/cuda/include

————————————

测试程序:

(仅供参考,但程序是官方给的。。见下:)

Testing Theano with GPU
from theanoimport function, config, shared, tensor

import numpy

import time

vlen =10 *30 *768  # 10 x #cores x # threads per core

iters =1000

rng = numpy.random.RandomState(22)

x = shared(numpy.asarray(rng.rand(vlen), config.floatX))

f = function([], tensor.exp(x))

print(f.maker.fgraph.toposort())

t0 = time.time()

for iin 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, tensor.Elemwise)and

              ('Gpu' not in type(x.op).__name__)

for xin f.maker.fgraph.toposort()]):

print('Used the cpu')

else:

print('Used the gpu')

你可能感兴趣的:(服务器安装(九):theano)