Implementing a model with multiple inputs in Keras, each with different sample sizes each (each size of each batch)

I am currently trying to implement a multi-entry model in Keras. The input consists of multiple batches and each one includes different samples, but I am getting a "different samples" error. My implementation looks like this:

The site of the model looks like this:

for s in range(NUM_STREAMS):
    inp.append(Input(shape=(16,8)))
...

      

The site where the error occurred:

history = model.train_on_batch(
                x=[x for x in X_batch],
                y=[y for y in y_batch]
            )

      

The error I am getting:

ValueError: All input arrays (x) should have the same number of
samples. Got array shapes: [(6, 16, 8), (7, 16, 8), (6, 16, 8), (6, 16, 8)]

      

The architecture of the abstract model looks like this:

Multiple inputs, multiple output

0


source to share


2 answers


FYI, faced with a similar problem, I rewrote my model in tensorflow since their computational graphs are not limited to constant batch size dimension.



+1


source


The input data form must be: (num_of_samples, dimension, dimension). For example, for 100x100 rgb images, this is (-1, 100, 100, 3). Try to check the data or change it in this format.



0


source







All Articles