question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Filter must not be larger than the input: Filter: (8, 8) Input: (3, 160)

See original GitHub issue

Hi,

I’m having this issue when running train steering model:

(snakes) guy_pavlov84@instance-1:~/research$ sudo ./train_steering_model.py --port 5557 --val_port 5556
Using TensorFlow backend.
Traceback (most recent call last):
  File "./train_steering_model.py", line 62, in <module>
    model = get_model()
  File "./train_steering_model.py", line 31, in get_model
    model.add(Convolution2D(16, 8, 8, subsample=(4, 4), border_mode="same"))
  File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 308, in add
    output_tensor = layer(self.outputs[0])
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 514, 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 572, 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 149, 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 466, in call
    filter_shape=self.W_shape)
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1579, in conv2d
    x = tf.nn.conv2d(x, kernel, strides, padding=padding)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 394, in conv2d
    data_format=data_format, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/op_def_library.py", line 704, in apply_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2262, in create_op
    set_shapes_for_outputs(ret)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1702, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/common_shapes.py", line 246, in conv2d_shape
    padding)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/common_shapes.py", line 184, in get2d_conv_output_size
    (row_stride, col_stride), padding_type)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/common_shapes.py", line 149, in get_conv_output_size
    "Filter: %r Input: %r" % (filter_size, input_size))
ValueError: Filter must not be larger than the input: Filter: (8, 8) Input: (3, 160)

Any idea what that might be? This is the setup:

(snakes) guy_pavlov84@instance-1:~/research$ pip freeze
funcsigs==1.0.2
h5py==2.6.0
Keras==1.1.0
mock==2.0.0
numpy==1.11.2
pbr==1.10.0
PyYAML==3.12
pyzmq==15.4.0
scipy==0.18.1
six==1.10.0
tensorflow==0.5.0
Theano==0.8.2
zmq==0.0.0

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

4reactions
pprivuletcommented, Oct 9, 2016

Hey I solved the problem following your instructions, thank you very much.

0reactions
ahmedyahia3393commented, Apr 19, 2018

in the view steering model.py file I found his error (ValueError: bad marshal data (unknown type code)) result when trying to execute the view steering model.py here is the result from the cmd prompt

Traceback (most recent call last): File "C:\Users\lenovo\Anaconda3\lib\site-packages\keras\utils\generic_utils.py ", line 229, in func_load raw_code = codecs.decode(code.encode(‘ascii’), ‘base64’) UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xe0’ in position 46: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “view_steering_model.py”, line 94, in model = model_from_json(json.load(jfile)) File “C:\Users\lenovo\Anaconda3\lib\site-packages\keras\models.py”, line 349, in model_from_json return layer_module.deserialize(config, custom_objects=custom_objects) File “C:\Users\lenovo\Anaconda3\lib\site-packages\keras\layers_init_.py”, l ine 55, in deserialize printable_module_name=‘layer’) File "C:\Users\lenovo\Anaconda3\lib\site-packages\keras\utils\generic_utils.py ", line 144, in deserialize_keras_object list(custom_objects.items()))) File “C:\Users\lenovo\Anaconda3\lib\site-packages\keras\models.py”, line 1349, in from_config layer = layer_module.deserialize(conf, custom_objects=custom_objects) File “C:\Users\lenovo\Anaconda3\lib\site-packages\keras\layers_init_.py”, l ine 55, in deserialize printable_module_name=‘layer’) File "C:\Users\lenovo\Anaconda3\lib\site-packages\keras\utils\generic_utils.py ", line 144, in deserialize_keras_object list(custom_objects.items()))) File “C:\Users\lenovo\Anaconda3\lib\site-packages\keras\layers\core.py”, line 711, in from_config function = func_load(config[‘function’], globs=globs) File "C:\Users\lenovo\Anaconda3\lib\site-packages\keras\utils\generic_utils.py ", line 234, in func_load code = marshal.loads(raw_code) ValueError: bad marshal data (unknown type code)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: Filter must not be larger than the input
So the problem is with the convolution sizes used. Convolution operations usually reduce dimension of the image.
Read more >
Group by: split-apply-combine — pandas 1.5.2 documentation
Discard data that belongs to groups with only a few members. Filter out data based on the group sum or mean. Some combination...
Read more >
Data Management Mechanisms for Embedded System ...
Section 7 offers insight into the shortcomings of the queue mechanisms and how those shortcomings can be mitigated. Section 8 defines filter mechanisms,...
Read more >
ValueError: Input 0 of layer conv2d is incompatible with the ...
The error message means that the input shape of Conv2D layer should be (128,128,1) which is consistent with your model summary.
Read more >
tf.nn.conv2d | TensorFlow v2.11.0
Computes a 2-D convolution given input and 4-D filters tensors. ... The input tensor may have rank 4 or higher, where shape dimensions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found