2

I was trying to build a 3D convolutional layer using keras. It works fine, but when I added a subsample parameter it crashed. The code:

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

the error is:

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

I am using theano 0.8.2.

Thanks

1 Answers1

1

You cannot use the subsample parameter with border_mode='same'. Use 'valid' or 'full'

Check out the line of code where the assertion error happens

Makis Tsantekidis
  • 2,698
  • 23
  • 38