GithubHelp home page GithubHelp logo

imatge-upc / activitynet-2016-cvprw Goto Github PK

View Code? Open in Web Editor NEW
195.0 20.0 85.0 92.37 MB

Tools to participate in the ActivityNet Challenge 2016 (NIPSW 2016)

Home Page: https://imatge-upc.github.io/activitynet-2016-cvprw/

License: MIT License

Shell 0.01% Jupyter Notebook 98.97% Python 1.02%

activitynet-2016-cvprw's Introduction

Temporal Activity Detection in Untrimmed Videos with Recurrent Neural Networks

This project page describes our paper at the 1st NIPS Workshop on Large Scale Computer Vision Systems. This work also corresponds to the submission of the UPC team participating in the ActivityNet Challenge for CVPR 2016.

Alberto Montes Amaia Salvador Xavier Giró-i-Nieto Santiago Pascual
Main contributor Advisor Advisor Co-advisor
Alberto Montes Amaia Salvador Xavier Giró-i-Nieto Santiago Pascual

Institution: Universitat Politècnica de Catalunya.

Universitat Politècnica de Catalunya

Abstract

This work proposes a simple pipeline to classify and temporally localize activities in untrimmed videos. Our system uses features from a 3D Convolutional Neural Network (C3D) as input to train a a recurrent neural network (RNN) that learns to classify video clips of 16 frames. After clip prediction, we post-process the output of the RNN to assign a single activity label to each video, and determine the temporal boundaries of the activity within the video. We show how our system can achieve competitive results in both tasks with a simple architecture. We evaluate our method in the ActivityNet Challenge 2016, achieving a 0.5874 mAP and a 0.2237 mAP in the classification and detection tasks, respectively.

What Are You Going to Find Here

This project is a baseline in the activity classification and its temporal location, focused on the ActivityNet Challenge. Here is detailed all the process of our proposed pipeline, as well the trained models and the utility to classify and temporally localize activities on new videos given. All the steps have been detailed, from downloading the dataset, to predicting the temporal locations going through the feature extraction and also the training.

Publication

Download our paper at the 1st NIPS Workshop on Large Scale Computer Vision Systems by clicking here. Please cite with the following Bibtex code:

@InProceedings{Montes_2016_NIPSWS,
author = {Montes, Alberto and Salvador, Amaia and Pascual, Santiago and Giro-i-Nieto, Xavier},
title = {Temporal Activity Detection in Untrimmed Videos with Recurrent Neural Networks},
booktitle = {1st NIPS Workshop on Large Scale Computer Vision Systems},
month = {December},
year = {2016}
}

You may also want to refer to our publication with the more human-friendly Chicago style:

Alberto Montes, Amaia Salvador, Santiago Pascual, and Xavier Giro-i-Nieto. "Temporal Activity Detection in Untrimmed Videos with Recurrent Neural Networks." In 1st NIPS Workshop on Large Scale Computer Vision Systems. 2016.

This work is the result of the bachelor thesis by Alberto Montes at UPC TelecomBCN ETSETB during Spring 2016. Please check his technical report, slides and oral presentation for more details.

Repository Structure

This repository is structured in the following way:

  • data/: dir where, by default, all the data such as videos or model weights are stored. Some data is given such ass the C3D means and also provide scripts to download the weights for the C3D model and the one we propose.
  • dataset/: files describing the ActivityNet dataset and a script to download all the videos. The information of the dataset has been extended with the number of frames at each of the videos.
  • misc/: directory with some miscellaneous information such as all the details of the steps followed on this project and much more.
  • notebooks/: notebooks with some visualization of the results.
  • scripts/: scripts to reproduce all the steps of project.
  • src/: source code required for the scripts.

Dependencies

This project is build using the Keras library for Deep Learning, which can use as a backend both Theano and TensorFlow.

We have used Theano in order to develop the project because it supported 3D convolutions and pooling required to run the C3D network.

For a further and more complete of all the dependencies used within this project, check out the requirements.txt provided within the project. This file will help you to recreate the exact same Python environment that we worked with.

Pipeline

The pipeline proposed to face the ActivityNet Challenge is made up by two stages.

The first stage encode the video information into a single vector representation for small video clips. To achieve that, the C3D network [Tran2014] is used. The C3D network uses 3D convolutions to extract spatiotemporal features from the videos, which previously have been split in 16-frames clips.

The second stage, once the video features are extracted, is to classify the activity on each clip as the videos of the ActivityNet are untrimmed and may be an activity or not (background). To perform this classification a RNN is used. More specifically a LSTM network which tries to exploit long term correlations and perform a prediction of the video sequence. This stage is the one which has been trained.

The structure of the network can be seen on the next figure.

Network Pipeline

To reproduce all the process of the pipeline, there is a detailed guide about how to reproduce all the steps with the scripts provided.

Related work

  • Tran, D., Bourdev, L., Fergus, R., Torresani, L., & Paluri, M. (2015, December). Learning spatiotemporal features with 3d convolutional networks. In 2015 IEEE International Conference on Computer Vision (ICCV) (pp. 4489-4497). IEEE. [paper] [code]
  • Sharma, S., Kiros, R., & Salakhutdinov, R. (2015). Action recognition using visual attention. arXiv preprint arXiv:1511.04119. [paper][code]
  • Yeung, S., Russakovsky, O., Mori, G., & Fei-Fei, L. (2015). End-to-end Learning of Action Detection from Frame Glimpses in Videos. arXiv preprint arXiv:1511.06984. [paper]
  • Yeung, Serena, et al. "Every moment counts: Dense detailed labeling of actions in complex videos." arXiv preprint arXiv:1507.05738 (2015).[paper]
  • Baccouche, M., Mamalet, F., Wolf, C., Garcia, C., & Baskurt, A. (2011, November). Sequential deep learning for human action recognition. In International Workshop on Human Behavior Understanding (pp. 29-39). Springer Berlin Heidelberg. [paper]
  • Shou, Zheng, Dongang Wang, and Shih-Fu Chang. "Temporal Action Localization in Untrimmed Videos via Multi-stage CNNs." [paper] [code]

Acknowledgements

We would like to especially thank Albert Gil Moreno and Josep Pujal from our technical support team at the Image Processing Group at the UPC.

Albert Gil Josep Pujal
Albert Gil Josep Pujal

Contact

If you have any general doubt about our work or code which may be of interest for other researchers, please use the issues section on this github repo. Alternatively, drop us an e-mail at [email protected].

activitynet-2016-cvprw's People

Contributors

albertomontesg avatar xavigiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activitynet-2016-cvprw's Issues

Dockerfile request

Hello! Can you please provide a dockerfile configuration for building a docker image. The requirements file is already nice, but it doesnt define enough the libs/cuda/cudnn versions to install on the os.

Thank you!

ValueError: You are trying to load a weight file containing 0 layers into a model with 11 layers.

Getting an error running the run_all_pipeline.py, might there be something wrong with the c3d-sports1M_weights.h5 weights file?

  File "run_all_pipeline.py", line 289, in <module>
    args.activity_threshold)
  File "run_all_pipeline.py", line 45, in run_all_pipeline
    model = C3D_conv_features(True)
  File "run_all_pipeline.py", line 233, in C3D_conv_features
    model.load_weights('data/models/c3d-sports1M_weights.h5')
  File "/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/keras/models.py", line 738, in load_weights
    topology.load_weights_from_hdf5_group(f, layers, reshape=reshape)
  File "/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/keras/engine/topology.py", line 3354, in load_weights_from_hdf5_group
    str(len(filtered_layers)) + ' layers.')
ValueError: You are trying to load a weight file containing 0 layers into a model with 11 layers.

What is error?

What is error?

Originally posted by @MuhammadAsadJaved in #27 (comment)

  1. My environment:
    my environment

Keras 1.0.2
numpy 1.11.2 or 1.16.2
jupyter 1.0.0
Theano 0.8.2
tensorflow-gpu 1.4.0
h5py 2.8.0
youtube-dl 2016.6.27

Cuda version 10.1.105
CUDNN version 7.5.0
NVIDIA-SMI 418.39

  1. Errors:

Exception: ("We can't determine the cudnn version as it is not available", 'CUDA not available')

AttributeError: ('The following error happened while compiling the node', <theano.sandbox.cuda.DnnVersion object at 0x7eff3655c510>(), '\n', 'The following error happened while compiling the node', GpuCAReduce{add}{1}(<CudaNdarrayType(float32, vector)>), '\n', "'module' object has no attribute '_get_ndarray_c_version'")

I have listed the two bugs that I have recorded. And sorry for my pressing the "closed" button by mistakes.

Environment details.

Hi am using Cuda 10 on ubuntu 16.04 and there is an error about Theano that
Your cuDNN version is more recent than the one Theano officially supports. If you see any problems, try updating Theano or downgrading cuDNN to version 5.

Can you give the details of your environment and system? I
Ubuntu =
CUDA =
Cudnn =

etc?

Error when run run_all_pipeline.py

Using Theano backend.
Traceback (most recent call last):
File "scripts/run_all_pipeline.py", line 8, in
from src.data import import_labels
ImportError: No module named src.data

"extract_features.py" stucks in a while loop

Hello i'm experiencing problem while running extract_features.py. It stucks in a while loop of extractor_process and saver_process because generator_process produces empty data queues. i don't know why data_gen_queue remains empty although VideoGenerator class is running successfully.
Kindly help me how to resolve this issue.
Thanks.

"Could not be read the video [video name]" when running "extract_features.p"

Hello, I'm running extract_features.py using the command KERAS_BACKEND=theano python -u extract_features.py -d ~/Videos/videos. Sometimes I see the program printing messages of Could not be read the video [video name], for example Could not be read the video Af_0zV79zsk, while Af_0zV79zsk.mp4 does exist under the path where I store all the downloaded videos of the ActivityNet dataset.

So my question is are those videos with this kind of messages printed still be extracted the C3D features?

GPU initialization error

Hi, I am getting this error when I am running run_all_pipeline.py file.
I have changed my ~/.theanorc file according to given instructions for this project.

(venv) asad@asad-Z370P-D3:~/activitynet-2016-cvprw$ python scripts/run_all_pipeline.py -i data/vid2.mp4
Using Theano backend.
ERROR (theano.sandbox.cuda): ERROR: Not using GPU. Initialisation of device gpu failed:
initCnmem: cnmemInit call failed! Reason=CNMEM_STATUS_OUT_OF_MEMORY. numdev=1

ERROR (theano.gof.opt): SeqOptimizer apply <theano.sandbox.cuda.dnn.NoCuDNNRaise object at 0x7fa416199510>
ERROR (theano.gof.opt): Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/opt.py", line 230, in apply
sub_prof = optimizer.optimize(fgraph)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/opt.py", line 89, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/dnn.py", line 2564, in apply
if not dnn_available():
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/init.py", line 322, in dnn_available
v = dnn_version()
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/init.py", line 412, in dnn_version
profile=False)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function.py", line 320, in function
output_keys=output_keys)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 479, in pfunc
output_keys=output_keys)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function_module.py", line 1777, in orig_function
defaults)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function_module.py", line 1641, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/link.py", line 690, in make_thunk
storage_map=storage_map)[:3]
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/vm.py", line 1003, in make_all
no_recycling))
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/init.py", line 256, in make_thunk
compute_map, no_recycling)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/op.py", line 970, in make_thunk
no_recycling)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/op.py", line 879, in make_c_thunk
output_storage=node_output_storage)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1200, in make_thunk
keep_lock=keep_lock)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1143, in compile
keep_lock=keep_lock)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1587, in cthunk_factory
key = self.cmodule_key()
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1285, in cmodule_key
c_compiler=self.c_compiler(),
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1364, in cmodule_key_
numpy.core.multiarray._get_ndarray_c_version())
AttributeError: ('The following error happened while compiling the node', <theano.sandbox.cuda.DnnVersion object at 0x7fa415f21bd0>(), '\n', "'module' object has no attribute '_get_ndarray_c_version'")

Traceback (most recent call last):
File "scripts/run_all_pipeline.py", line 5, in
from keras.layers import (LSTM, BatchNormalization, Convolution3D, Dense, Dropout, Flatten, Input,
File "/home/asad/venv/local/lib/python2.7/site-packages/keras/init.py", line 3, in
from . import backend
File "/home/asad/venv/local/lib/python2.7/site-packages/keras/backend/init.py", line 51, in
from .theano_backend import *
File "/home/asad/venv/local/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 5, in
import theano
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/init.py", line 111, in
theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/tests/test_driver.py", line 31, in test_nvidia_driver1
profile=False)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function.py", line 320, in function
output_keys=output_keys)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/pfunc.py", line 479, in pfunc
output_keys=output_keys)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function_module.py", line 1777, in orig_function
defaults)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/compile/function_module.py", line 1641, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/link.py", line 690, in make_thunk
storage_map=storage_map)[:3]
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/vm.py", line 1003, in make_all
no_recycling))
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda/init.py", line 256, in make_thunk
compute_map, no_recycling)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/op.py", line 970, in make_thunk
no_recycling)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/op.py", line 879, in make_c_thunk
output_storage=node_output_storage)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1200, in make_thunk
keep_lock=keep_lock)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1143, in compile
keep_lock=keep_lock)
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1587, in cthunk_factory
key = self.cmodule_key()
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1285, in cmodule_key
c_compiler=self.c_compiler(),
File "/home/asad/venv/local/lib/python2.7/site-packages/theano/gof/cc.py", line 1364, in cmodule_key_
numpy.core.multiarray._get_ndarray_c_version())
AttributeError: ('The following error happened while compiling the node', GpuCAReduce{add}{1}(<CudaNdarrayType(float32, vector)>), '\n', "'module' object has no attribute '_get_ndarray_c_version'")

Multiple Errors while running "extract_features.py"

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 :)

ActivitynetDataset python file is missing

I'm trying to run the 02 Exploring Dataset ipython notebook, but it failed with ImportError: No module named work.dataset.activitynet.

Where can I find the activitynet related python files?

Thanks,

[scripts] Potential bug in generate_output during create_stateful_dataset

Hi guys,

Thank you for sharing your work. It is self-contained and easy to read.

The logic used in the function generate_output is a little bit confusing to me. This line appends the index of the label into output but the else case appends the label into output.
I noticed that the output might end up being something like ['none', 2, 2, 'none', 'none']. This input generated an error with the function to_categorical.

Disclaimer: I haven't run the code from scratch. Feel free to close the issue, if you are sure about the logic of the if statement.

"extract_features.py" freezes

Hello, I'm running extract_features.py using the command KERAS_BACKEND=theano python -u extract_features.py -d ~/Videos/videos. However, the program will freeze and refuse to make any further progress with the latest printed messages only showing

Time to fetch [video name] video: [time] seconds
Time to fetch [video name] video: [time] seconds
Time to fetch [video name] video: [time] seconds

I could only force extract_features.py terminated, and run the command again to continue.
Is it normal that extract_features.py freezes?

run_all_pipeline in CPU mode

Is it possible to run the pipeline in CPU mode ?
If so, what changes must I do ?
I get the following error while trying to run in CPU mode :

Using Theano backend.
Reading Video...
Duration: 130.6s
FPS: 30.0
Number of frames: 3919
Loading C3D network...
Traceback (most recent call last):
File "scripts/run_all_pipeline.py", line 188, in
args.activity_threshold
File "scripts/run_all_pipeline.py", line 40, in run_all_pipeline
model = C3D_conv_features(True)
File "scripts/run_all_pipeline.py", line 99, in C3D_conv_features
trainable=False))
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 114, in add
layer.create_input_layer(batch_input_shape, input_dtype)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 341, in create_input_layer
self(x)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 485, 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 543, 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 148, 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 552, in call
filter_shape=self.W_shape)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py", line 919, in conv3d
conv_out = dnn.dnn_conv3d(x, kernel, border_mode=border_mode)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/dnn.py", line 1257, in dnn_conv3d
return GpuDnnConv3d(algo=algo)(img, kerns, out, desc)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/dnn.py", line 513, in init
super(GpuDnnConv3d, self).init(inplace=inplace, algo=algo)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/dnn.py", line 328, in init
if version() < (3000, 3000):
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/init.py", line 407, in dnn_version
dnn_available.msg)
Exception: ("We can't determine the cudnn version as it is not available", 'CUDA not available')

What is stateful dataset?

Could you please explain me what is stateful dataset and how it is created. I have seen the code as well as the presentation but could not find a good explanation on how it is created and logic of its creation. It would be great if anyone could explain that.

Create stateful dataset

Does it make sense to run 'create_stateful_dataset.py' file for new test videos?

If yes, how can I do it, after extracting the features of new test videos?

Error running create_stateful_dataset.py

(venv)ubuntu@ubuntu-S2600CW:~/Desktop/yc/activitynet-2016-cvprw-master$ python scripts/create_stateful_dataset.py
Number of videos for training subset: 38
Number of batches: 0
Creating stateful dataset for training subset
0% ( 0 of 256) | | Elapsed Time: 0:00:00 ETA: --:--:--Traceback (most recent call last):
File "scripts/create_stateful_dataset.py", line 138, in
args.subset
File "scripts/create_stateful_dataset.py", line 89, in create_stateful_dataset
output[video_index] = to_categorical(output_classes, nb_classes=output_size)
File "/home/ubuntu/Desktop/yc/activitynet-2016-cvprw-master/scripts/src/data.py", line 30, in to_categorical
Y[i, y[i]] = 1.
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

(This is the error i get after run create_stateful_dataset.py with the dataset downloaded from youtube. Then i try to troubleshoot it and i found the problem is from data.py as i get "None" for variable output:

for start_frame in start_frames:
    # Obtain the label for this isntance and then its output
    output = None

    outs = outputs[start_frame:start_frame+length]
    if outs.count(label) >= length / 2:
        output = labels.index(label)
    else:
        output = labels[0] <----------------------it will jump to this everytime i run create_stateful_dataset.py
    instances.append(output)

Error while running run_all_pipeline.py

I get the following error while trying to execute run_all_pipeline.py:
Also, I am using only CPU

Traceback (most recent call last):
File "scripts/run_all_pipeline.py", line 4, in
from keras.layers import (LSTM, BatchNormalization, Convolution3D, Dense, Dropout, Flatten, Input,
File "/home2/koushik/venv/local/lib/python2.7/site-packages/keras/init.py", line 3, in
from . import backend
File "/home2/koushik/venv/local/lib/python2.7/site-packages/keras/backend/init.py", line 54, in
from .tensorflow_backend import *
File "/home2/koushik/venv/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1, in
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/init.py", line 75, in
from tensorflow.core.framework.graph_pb2 import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/core/framework/graph_pb2.py", line 6, in
from google.protobuf import descriptor as _descriptor
File "/usr/local/lib/python2.7/dist-packages/google/protobuf/init.py", line 37, in
import('pkg_resources').declare_namespace(name)
File "/home2/koushik/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 22, in
import zipfile
File "/usr/lib/python2.7/zipfile.py", line 501, in
class ZipExtFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

Where is get_nb_frames.py?

According to the notebook "01 Checking Downloaded Videos" we're suppose to run:

python get_nb_frames.py ../../dataset/tmp/dataset_downloaded.json ../../dataset/tmp/dataset_downloaded_nb_frames.json

Where is get_nb_frames.py? Can't seem to locate it.

Applying PCA on Features extracted

Can you please guide or suggest a suitable repository which guides on how to calculate PCA after we have extracted features from (1,6,4096) to (1,6,500)?

I tried several methods but was facing issues so it would be great if you could guide in this matter.

Looking forward to hearing from you soon and thanking you in advance.

What exactly is the dependencies for the project configuration?

Can you tell which versions are the following dependencied: Ubuntu, python, cuda, cudnn, tensorflow, keras?

I've tried to switch keras from 1.0.4 to 2.0, CUDA from 10.1/10.1 to 8.0, cudnn is switching and tensorflow is reinstalled, still fail to run the pipeline.

My current configuration: Ubuntu 16.04, Anaconda 2.7.4 (python = 2.7.4), CUDA = 10.0, keras = 2.0. I have installed the dependencies followed by the "requirements.txt".

Error pop_layer() Model

extracted_features.py

model.pop_layer()
AttributeError: 'Sequential' object has no attribute 'pop_layer'

Keras 1.1.1

Can we use other dataset for training?

The Youtube dataset is too big.I want to know if I can use other dataset such as UCF101 for training?
I have test your trained model on UCF101,but the result is not good.

Theano and gpuarray/pygpu compatibility

Which versions of libgpuarray and pygpu should be used? I get the following error with gpuarray 0.6.4

RuntimeError: ('Wrong major API version for gpuarray:', 1, 'Make sure Theano and libgpuarray/pygpu are in sync.')

can not run it!

Recently,I want to study the project of activitynet-2016-cvprw,but i meet some problem!

As #18 deccribing, I change the code

def run_all_pipeline(input_video, smoothing_k, activity_threshold):
input_size = (112, 112)

to

def run_all_pipeline(input_video, smoothing_k, activity_threshold):
input_size = ((16, 112, 112, 3)

, then,i run command "python scripts/run_all_pipeline.py -i changge.mp4",but another probelm appear. as u see blow:

Using TensorFlow backend.
Reading Video...
Duration: 30.7s
FPS: 24.9
Number of frames: 765
Traceback (most recent call last):
File "scripts/run_all_pipeline.py", line 284, in
args.activity_threshold)
File "scripts/run_all_pipeline.py", line 35, in run_all_pipeline
video_array = video_array.reshape((nb_clips, length, 3, 112, 112))
ValueError: cannot reshape array of size 4042752 into shape (47,16,3,112,112)

how i can run this demo smoothly? hope for you answer.

Error loading C3D network

I have been getting the following error while running /run_all_pipeline.py :

ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 1, 'for cmd', 'nvcc -shared -O3 -m64 -Xcompiler -DCUDA_NDARRAY_CUH=c72d035fdf91890f3b36710688069b2e,-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,-fPIC,-fvisibility=hidden -Xlinker -rpath,/home/chamin/.theano/compiledir_Linux-4.4--generic-x86_64-with-Ubuntu-16.04-xenial-x86_64-2.7.12-64/cuda_ndarray -I/home/chamin/repos/activitynet-2016-cvprw/venv/local/lib/python2.7/site-packages/theano/sandbox/cuda -I/home/chamin/repos/activitynet-2016-cvprw/venv/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -I/home/chamin/repos/activitynet-2016-cvprw/venv/local/lib/python2.7/site-packages/theano/gof -o /home/chamin/.theano/compiledir_Linux-4.4--generic-x86_64-with-Ubuntu-16.04-xenial-x86_64-2.7.12-64/cuda_ndarray/cuda_ndarray.so mod.cu -L/usr/lib -lcublas -lpython2.7 -lcudart')

I have been using cuda on keras on python 2.7 on other projects. Any pointer to start debugging will be of great help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.