title: C3D + LSTM for video classification
body: <p>I want to use C3D model followed by lstm to train UCF101 for video classification using keras.
  I have reshaped the video to be [None, 16, 112, 112,3]. I have used time distributed keras function in C3D but yet I still did not get what should the input shape for this model, the output shape, and the time steps number. could  anyone help me in this issue. 
  thanks</p>
  
  <pre><code>model = Sequential()
  model.add(TimeDistributed(Conv3D(64, 3, activation='relu', padding='same', name='conv1', input_shape=shape)))
  model.add(TimeDistributed(MaxPooling3D(pool_size=(1,2,2), strides=(1,2,2), padding='same', name='pool1')))
  
  model.add(TimeDistributed(Conv3D(128, 3, activation='relu', padding='same', name='conv2')))
  model.add(TimeDistributed(MaxPooling3D(pool_size=(2,2,2), strides=(2,2,2), padding='valid', name='pool2')))
  
  model.add(TimeDistributed(Conv3D(256, 3, activation='relu', padding='same', name='conv3a')))
  model.add(TimeDistributed(Conv3D(256, 3, activation='relu', padding='same', name='conv3b')))
  model.add(TimeDistributed(MaxPooling3D(pool_size=(2,2,2), strides=(2,2,2), padding='valid', name='pool3')))
  
  model.add(TimeDistributed(Conv3D(512, 3, activation='relu', padding='same', name='conv4a')))
  model.add(TimeDistributed(Conv3D(512, 3, activation='relu', padding='same', name='conv4b')))
  model.add(TimeDistributed(MaxPooling3D(pool_size=(2,2,2), strides=(2,2,2), padding='valid', name='pool4')))
  
  model.add(TimeDistributed(Conv3D(512, 3, activation='relu', padding='same', name='conv5a')))
  model.add(TimeDistributed(Conv3D(512, 3, activation='relu', padding='same', name='conv5b')))
  model.add(TimeDistributed(ZeroPadding3D(padding=(0,1,1))))
  model.add(TimeDistributed(MaxPooling3D(pool_size=(2,2,2), strides=(2,2,2), padding='valid', name='pool5')))
  
  model.add(TimeDistributed(Flatten()))
  
  model.add(TimeDistributed(Dense(4096, activation='relu', name='fc6')))
  model.add(TimeDistributed(Dropout(0.5)))
  model.add(TimeDistributed(Dense(4096, activation='relu', name='fc7')))
  model.add(TimeDistributed(Dropout(0.5)))
  model.add(TimeDistributed(Dense(487, activation='softmax', name='fc8')))
  
  model.add(Dropout(0.5))
  model.add(LSTM(256, return_sequences=True, dropout = 0.5, input_shape = (time_step_nbr, 487)))
  model.add(TimeDistributed(Dense(101, activation='softmax')))
  model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['acc'])
  </code></pre>