Troy Zuroske
Troy Zuroske

Reputation: 762

Theano Test File Will Not Compile

I have been trying to install Theano for windows 7 64 bit machine based off of the tutorial found on the website here. I have gotten almost everything to work but after installing CUDA 5.5 and then continuing to on verifying the programs with these commands:

"Please do so, and verify that the following programs are found:

  1. where gcc
  2. where gendef
  3. where cl
  4. where nvcc"

The first three work fine but the last one returns "INFO: Could not find files for the given pattern(s)." I am not sure why because I installed CUDA and nvcc should be found. This is causing a larger problem because when I try to run this test file:

import numpy as np
import time
import theano
A = np.random.rand(1000,10000).astype(theano.config.floatX)
B = np.random.rand(10000,1000).astype(theano.config.floatX)
np_start = time.time()
AB = A.dot(B)
np_end = time.time()
X,Y = theano.tensor.matrices('XY')
mf = theano.function([X,Y],X.dot(Y))
t_start = time.time()
tAB = mf(A,B)
t_end = time.time()
print "NP time: %f[s], theano time: %f[s] (times should be close when run on CPU!)" %(np_end-np_start, t_end-t_start)
print "Result difference: %f" % (np.abs(AB-tAB).max(), )

Eclipsed throws the error at the fourth line under config saying "Undefined variable from import: config". Then when I run it anyways the error in the console is "AttributeError: 'module' object has no attribute 'config'"

Any suggestions or advice on any of this is much appreciated.

Upvotes: 1

Views: 214

Answers (1)

nouiz
nouiz

Reputation: 5071

The first problem was fixed in the comments on the question.

For the import, I suggest that you uninstall Theano. Do this many times to make sure you remove all version. Depending how you installed python, it could have installed an old version of Theano at the same time.

Then install Theano development version.

Then it can't find theano.config, most of the time is because there is problem in the installation or you use an old version that had problems related to Windows.

Upvotes: 1

Related Questions