2014-05-21 44 views
0

我正在按照教程創建convolution neural network with Theano。雖然,我在一段代碼有一個問題:ImportError:No module named'theano.floatX'

>> x = theano.floatX.xmatrix(theano.config.floatX) # rasterized images 
AttributeError: 'module' object has no attribute 'floatX' 

我裝floatX有:

>> from theano import config 

,並檢查:

>> print(theano.config.floatX) 
float 32 

但仍無法加載模塊xmatrix,這應該在theano.config.floatX,從documentation判斷。有人知道我在哪裏可以找到它嗎?

預先感謝您!

回答

1

這部分的convnet教程有一個bug或者是非常過時的。 Theano中的符號變量位於theano.tensor包中。這個包theano.floatX甚至不存在!

教程github存儲庫中的當前版本正常工作。他們分配符號變量的正確方法:

# allocate symbolic variables for the data 
    index = T.lscalar() # index to a [mini]batch 
    x = T.matrix('x') # the data is presented as rasterized images 
    y = T.ivector('y') # the labels are presented as 1D vector of 
         # [int] labels 

瀏覽教程庫我找到了revision where this bug was corrected。 他們似乎忘記了使用此修補程序更新教程文本。

+1

這是正確的答案。我只是將修補程序推送到存儲庫。該網頁應在下一小時更新。這是一個bug,theano.floatX從來沒有存在過。 – nouiz

+0

謝謝,夥計們! – grin