I am kind of new to keras. Here is what I am trying to achieve. I have a keras-model which takes as input an image to produce 512 vector. I create this as:
input_img = keras.layers.Input( shape=(240, 320, 3 ) )
cnn = make_vgg( input_img )
out = NetVLADLayer(num_clusters = 16)( cnn )
model = keras.models.Model( inputs=input_img, outputs=out )
Now, for the training, each of my samples are actually 13 images. Say I have 2500 samples then my data's dimensions are 2500x13x240x320x3. I want the model to be applied independently to the 13 images. I came across the TimeDistributed layer in keras and wondering how can I use it to achieve my objective.
t_input = Input( shape=(13,240,320,3) )
# How to use TimeDistributed with model?
t_out = TimeDistributed( out )
t_model = Model( inputs=t_input, outputs=t_out )
I am expecting t_out of size: None,13,512. The above code, however, throws a ValueError. Can anyone help my understanding?
