训练期间theano-lasange function_module维度不匹配错误

时间:2016-10-21 13:45:22

标签: python theano lasagne kaggle

我正在尝试从链接中集成部分代码(configuration / convroll4.py):https://github.com/benanne/kaggle-ndsb

convroll4.py的第一层(循环切片层)存在维度不匹配问题。代码行是:

l0 = nn.layers.InputLayer((batch_size, 1, patch_size[0], patch_size[1]))
l0c = dihedral.CyclicSliceLayer(l0)

我在培训期间遇到以下错误:

line in train vl, va = val_fn(Xb, yb):

请注意,这是代码训练循环的一部分,下面给出了代码段:

for Xb, yb in L_val:
    yb = yb.flatten().astype(np.int32)
    vl, va = val_fn(Xb, yb)

错误如下:

File "/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 871, in __call__
storage_map=getattr(self.fn, 'storage_map', None))

File "/anaconda/lib/python2.7/site-packages/theano/gof/link.py", line 314,  in raise_with_op
reraise(exc_type, exc_value, exc_trace)

File "/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 859, in __call__
outputs = self.fn()

ValueError: dimension mismatch in x,y_idx arguments
Apply node that caused the error: GpuCrossentropySoftmaxArgmax1HotWithBias(GpuDot22.0, b, GpuFromHost.0)
Toposort index: 419

Inputs types: [CudaNdarrayType(float32, matrix), CudaNdarrayType(float32, vector), CudaNdarrayType(float32, vector)]
Inputs shapes: [(32, 2), (2,), (128,)]
Inputs strides: [(2, 1), (1,), (1,)]
Inputs values: ['not shown', CudaNdarray([ 0.05  0.05]), 'not shown']

Outputs clients: [[GpuCAReduce{add}{1}(GpuCrossentropySoftmaxArgmax1HotWithBias.0)], [], []]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. 
This can be done with by setting the Theo flag 'optimizer=fast_compile'.   
If that does not work, Theano optimizations can be disabled with 'optimizer=None'.

HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

这导致python包中的错误(注意:我使用的是Theano 0.8.0)而不是链接中的代码。请帮助说明可能出现的问题。

0 个答案:

没有答案