2

我试图使用 keras 构建一个 3D 卷积层。它工作正常,但是当我添加一个子样本参数时它崩溃了。编码:

l_1 = Convolution3D(2, 10,10,10,
    border_mode='same', 
    name = 'l_1',
    activation='relu',
    subsample = (5,5,5)
    )(inputs)

错误是:

Traceback (most recent call last):
  File "image_proc_09.py", line 244, in <module>
    )(inputs)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in __call__
    self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 635, in add_inbound_node
    Node.create_node(self, inbound_layers, node_indices, tensor_indices)
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 166, in create_node
    output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 1234, in call
    filter_shape=self.W_shape)
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py", line 1627, in conv3d
    dim_ordering, volume_shape, filter_shape)
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py", line 1686, in _old_theano_conv3d
    assert(strides == (1, 1, 1))
AssertionError

我正在使用theano 0.8.2。

谢谢

4

1 回答 1

1

您不能将subsample参数与border_mode='same'. 使用'valid''full'

查看发生断言错误的代码行

于 2017-02-17T12:06:47.047 回答