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

Multiple Errors while running "extract_features.py" #18

Open
unkemptArc99 opened this issue Aug 24, 2017 · 5 comments
Open

Multiple Errors while running "extract_features.py" #18

unkemptArc99 opened this issue Aug 24, 2017 · 5 comments

Comments

@unkemptArc99
Copy link

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
Copy link

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
Copy link
Author

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

@singhania1408
Copy link

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
Copy link

singhania1408 commented Feb 5, 2018

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
Copy link

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

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

4 participants