Wie konfigurieren theano auf Windows?

Habe ich Installiert Theano auf einer Windows Maschine und folgte der Konfiguration Anweisungen.

Legte ich die folgenden .theanorc.txt Datei in C:\Users\my_username Ordner:

#!sh
[global]
device = gpu
floatX = float32

[nvcc]
fastmath = True
# flags=-m32 # we have this hard coded for now

[blas]
ldflags =
# ldflags = -lopenblas # placeholder for openblas support

Ich versuchte, führen Sie den test, aber habe noch nicht geschafft es zum laufen auf der GPU. Ich denke, die Werte aus .theanorc.txt nicht Lesen, da habe ich noch die Zeile print config.Gerät und Ausgaben "cpu".

Unten ist der grundlegende test-Skript und die Ausgabe:

from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time

print config.device


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([], T.exp(x))
print f.maker.fgraph.toposort()
t0 = time.time()
for i in xrange(iters):
    r = f()
t1 = time.time()
print 'Looping %d times took' % iters, t1 - t0, 'seconds'
print 'Result 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'

Ausgabe:

pydev debugger: starting (pid: 9564)
cpu
[Elemwise{exp,no_inplace}(<TensorType(float64, vector)>)]
Looping 1000 times took 10.0310001373 seconds
Result is [ 1.23178032  1.61879341  1.52278065 ...,  2.20771815  2.29967753
  1.62323285]
Used the cpu

Habe ich installiert, CUDA-Toolkit erfolgreich, aber noch nicht geschafft zu installieren pyCUDA. Ich denke, Theano funktionieren sollte, ohne pyCUDA installiert sowieso.

Ich wäre sehr dankbar, wenn jemand aushelfen könnte, dieses problem zu lösen. Ich habe diese Anweisungen, aber nicht wissen, warum die Werte für die Konfiguration in das Programm nicht den Werten entsprechen, die in .theanorc.txt Datei.

InformationsquelleAutor Niko Gamulin | 2015-01-18

Schreibe einen Kommentar