theano:进行 3d 卷积时出现 conv3d2d 错误

theano: conv3d2d error while doing 3d convolution

我尝试使用 conv3d2d 制作 3d CNN。我收到以下错误消息(我的代码位于 enter link description here):

Traceback (most recent call last):

File "/home/shome/workspace_temp/conv3d_test/conv3d_test.py", line 1, in from convnet3d import ConvLayer

File "/home/shome/softwares/theano/Theano-3D-ConvNet-master/convnet3d/convnet3d.py", line 12, in from conv3d2d import conv3d

File "/home/shome/softwares/theano/Theano-3D-ConvNet-master/convnet3d/conv3d2d.py", line 298, in make_gpu_optimizer(DiagonalSubtensor, [0])

File "/home/shome/softwares/theano/Theano-3D-ConvNet-master/convnet3d/conv3d2d.py", line 266, in make_gpu_optimizer @theano.gof.local_optimizer([])

File "/usr/local/lib/python2.7/dist-packages/theano/gof/opt.py", line 948, in decorator raise ValueError,

("Use None instead of an empty list to apply to all nodes.", f.__module__, f.__name__)

ValueError: ('Use None instead of an empty list to apply to all nodes.', 'conv3d2d', 'local_to_gpu').

我的CNN构造如下:

layer_0_input=x.reshape(batch_size,1,28,28,28)
**layer0=ConvLayer(layer_0_input, 1, nkerns[0], (5,5,5), (28,28,28), 100, T.tanh )**
layer1=PoolLayer(layer0.output, (2,2,2))
**layer2=ConvLayer(layer1.output, nkerns[0], nkerns[1], (5,5,5), (12,12,12), 100, T.tanh)**
layer3=PoolLayer(layer2.output, (2,2,2))
layer4_input=layer3.output.flatten(2)
layer4=HiddenLayer(layer4_input, nkerns[1]*4*4*4, 500, T.tanh)
layer5=LogRegr(layer4.output, 500, 10, rng1)

我认为错误在于实例化 Convlayer。有人可以帮忙吗?

您的 conv3d2d.py 文件似乎是从较早版本的 Theano 复制而来的,@theano.gof.local_optimizer 的语法自此发生了变化。

如果你看一下最新master中的updated version,对装饰器的调用已经从@theano.gof.local_optimizer([])改为@theano.gof.local_optimizer([op, cuda.gpu_from_host])

不过,仅应用该更改可能还不够,因此您最好从 Theano 导入 conv3d2d 而不是您的存储库,或者更新整个文件。