Skip to content

I met this error about CorrMM images and kernel must have the same stack size #36

@hhya1013

Description

@hhya1013

Thanks for you code,whenI run it,i met this error, I hope you can help me solve this problem.
Traceback (most recent call last):
File "main.py", line 114, in
predictions = m.predict_generator(generator_test(b_s=b_s, imgs_test_path=imgs_test_path), nb_imgs_test)[0]
File "/home/han/.local/lib/python2.7/site-packages/keras/engine/training.py", line 1634, in predict_generator
outs = self.predict_on_batch(x)
File "/home/han/.local/lib/python2.7/site-packages/keras/engine/training.py", line 1274, in predict_on_batch
outputs = self.predict_function(ins)
File "/home/han/.local/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 717, in call
return self.function(*inputs)
File "/home/han/.local/lib/python2.7/site-packages/theano/compile/function_module.py", line 898, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/han/.local/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/han/.local/lib/python2.7/site-packages/theano/compile/function_module.py", line 884, in call
self.fn() if output_subset is None else
ValueError: CorrMM images and kernel must have the same stack size

Apply node that caused the error: CorrMM{half, (1, 1), (1, 1)}(InplaceDimShuffle{0,3,1,2}.0, Subtensor{::, ::, ::int64, ::int64}.0)
Toposort index: 1222
Inputs types: [TensorType(float32, (True, False, False, False)), TensorType(float32, 4D)]
Inputs shapes: [(1, 40, 512, 30), (1, 1, 512, 512)]
Inputs strides: [(160, 4, 4800, 160), (1048576, 1048576, -2048, -4)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Subtensor{int64:int64:int8, int64:int64:int8, int64:int64:int8, :int64:}(CorrMM{half, (1, 1), (1, 1)}.0, Constant{0}, Constant{1}, Constant{1}, ScalarFromTensor.0, ScalarFromTensor.0, Constant{1}, ScalarFromTensor.0, ScalarFromTensor.0, Constant{1}, Constant{30})]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "main.py", line 65, in
m = Model(input=[x, x_maps], output=sam_resnet([x, x_maps]))
File "/home/han/sam-master/models.py", line 136, in sam_resnet
nb_cols=3, nb_rows=3)(att_convlstm)
File "/home/han/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 514, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home/han/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home/han/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/home/han/sam-master/attentive_convlstm.py", line 143, in call
initial_states = self.get_initial_states(x)
File "/home/han/sam-master/attentive_convlstm.py", line 42, in get_initial_states
initial_state = K.conv2d(initial_state, K.zeros((self.nb_filters_out, self.nb_filters_in, 1, 1)), border_mode='same')
File "/home/han/.local/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 1135, in conv2d
filter_shape=filter_shape)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions