Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error run spatial_stream_cnn #4

Open
pribadihcr opened this issue Nov 20, 2016 · 2 comments
Open

error run spatial_stream_cnn #4

pribadihcr opened this issue Nov 20, 2016 · 2 comments

Comments

@pribadihcr
Copy link

Hi @wadhwasahil

I got error:
Traceback (most recent call last):
File "spatial_stream_cnn.py", line 149, in
model = VGG_16(img_rows,img_cols,'vgg16_weights.h5')
File "spatial_stream_cnn.py", line 101, in VGG_16
model.add(MaxPooling2D((2,2), strides=(2,2)))
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/pooling.py", line 162, in call
dim_ordering=self.dim_ordering)
File "/usr/local/lib/python2.7/dist-packages/keras/layers/pooling.py", line 212, in _pooling_function
border_mode, dim_ordering, pool_mode='max')
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1701, in pool2d
x = tf.nn.max_pool(x, pool_size, strides, padding=padding)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 850, in max_pool
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 1440, in _max_pool
data_format=data_format, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2382, in create_op
set_shapes_for_outputs(ret)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1783, in set_shapes_for_outputs
shapes = shape_func(op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 596, in call_cpp_shape_fn
raise ValueError(err.message)
ValueError: Negative dimension size caused by subtracting 2 from 1

Thanks

@kvignesh1420
Copy link

@pribadihcr

try changing the image_dim_ordering parameter to 'th' from 'tf'. in the .keras/json file

@wadhwasahil
Copy link
Owner

@pribadihcr is it resolved now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants