wadhwasahil / Video-Classification-2-Stream-CNN

Video Classification using 2 stream CNN
312 stars 109 forks source link

error run spatial_stream_cnn #4

Open pribadihcr opened 7 years ago

pribadihcr commented 7 years ago

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 commented 7 years ago

@pribadihcr

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

wadhwasahil commented 7 years ago

@pribadihcr is it resolved now?