imatge-upc / activitynet-2016-cvprw

Tools to participate in the ActivityNet Challenge 2016 (NIPSW 2016)
https://imatge-upc.github.io/activitynet-2016-cvprw/
MIT License
195 stars 85 forks source link

Multiple Errors while running "extract_features.py" #18

Open unkemptArc99 opened 7 years ago

unkemptArc99 commented 7 years ago

Hi! I was recently trying to implement the activitynet project by following steps in the "Step-by-step Instruction" manual. I started getting these errors during the execution of "extract_features.py." Notably, the error starts as soon as the first video is fetched.

My console output :

Time to fetch a-6rpItrRSk video: 5.37 seconds

extract_features.py:182: UserWarning: Update your 'Conv3D' call to the Keras 2 API: 'Conv3D(64, (3, 3, 3), name="conv1", activation="relu", trainable=False, input_shape=(3, 16, 11..., padding="same", strides=(1, 1, 1))' 
trainable=False))
extract_features.py:188: UserWarning: Update your 'MaxPooling3D' call to the Keras 2 API: 'MaxPooling3D(padding="valid", strides=(1, 2, 2), name="pool1", pool_size=(1, 2, 2))' 
name='pool1'))
extract_features.py:200: UserWarning: Update your 'Conv3D' call to the Keras 2 API: 'Conv3D(128, (3, 3, 3), name="conv2", activation="relu", trainable=False, padding="same", strides=(1, 1, 1))'
trainable=False))
extract_features.py:206: UserWarning: Update your 'MaxPooling3D' call to the Keras 2 API: 'MaxPooling3D(padding="valid", strides=(2, 2, 2), name="pool2", pool_size=(2, 2, 2))' 
name='pool2'))
extract_features.py:218: UserWarning: Update your 'Conv3D' call to the Keras 2 API: 'Conv3D(256, (3, 3, 3), name="conv3a", activation="relu", trainable=False, padding="same", strides=(1, 1, 1))' trainable=False))
extract_features.py:229: UserWarning: Update your 'Conv3D' call to the Keras 2 API: 'Conv3D(256, (3, 3, 3), name="conv3b", activation="relu", trainable=False, padding="same", strides=(1, 1, 1))' trainable=False))
extract_features.py:235: UserWarning: Update your 'MaxPooling3D' call to the Keras 2 API: 'MaxPooling3D(padding="valid", strides=(2, 2, 2), name="pool3", pool_size=(2, 2, 2))' 
name='pool3'))

Process Process-9:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "extract_features.py", line 85, in extranting_features_task
    model = C3D_conv_features(summary=True)
  File "extract_features.py", line 235, in C3D_conv_features
    name='pool3'))
  File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 469, in add
    output_tensor = layer(self.outputs[0])
  File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 596, in __call__
    output = self.call(inputs, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/pooling.py", line 323, in call
    data_format=self.data_format)
  File "/usr/local/lib/python2.7/dist-packages/keras/layers/pooling.py", line 381, in _pooling_function
    padding, data_format, pool_mode='max')
  File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 3418, in pool3d
    x = tf.nn.max_pool3d(x, pool_size, strides, padding=padding)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 1625, in max_pool3d
    strides=strides, padding=padding, name=name)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
    op_def=op_def)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2329, in create_op
    set_shapes_for_outputs(ret)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1717, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1667, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
    debug_python_shape_fn, require_shape_fn)
  File "/home/gpuuser/.local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 676, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Negative dimension size caused by subtracting 2 from 1 for 'pool3/MaxPool3D' (op: 'MaxPool3D') with input shapes: [?,1,4,28,256].

Any help would be appreciated :)

1461190388 commented 7 years ago

hellow sir , i face this problem when runing this file " Unable to create file (Unable to open file: name = 'data/dataset/video_features.hdf5', errno = 2, error message = 'no such file or directory', flags = 13, o_flags = 242) can you tell me how to resolve it ? which this i am missing ?

unkemptArc99 commented 7 years ago

@1461190388 have you tried giving sudo access to your program??

singhania1408 commented 6 years ago

It can be resolved by changing input dimensions of keras model because you are using tensorflow as backend, so it needs to be in format of frames, height, width, color codes. Change your first layer group input to input=(16, 112, 112, 3) then it will work correctly with tensorflow backend.

singhania1408 commented 6 years ago

qiangzhang007 I am taking of changing input dimension in 3d_cnn part, not in run_all_pipeline. So just use this input dimension to extract features file. But finally, you are unable to run it as I have mentioned key error issue #21 because of weight file provided by sports dataset in 3d-CNN.

supun-kanda commented 5 years ago

this is because the backend used in code used theano while you try to run it on tensorflow

just import this at the top instead of change each line by line for channels.

from keras import backend as K K.set_image_dim_ordering('th')

problem solved