I am training a Keras Tensorflow model with three inputs and two outputs:
mymodel = tf.keras.Model([X1, X2, X3], [y1, y2])
When I fit this model by separately specifying x
and y
data, it works fine without any hitches:
history = mymodel.fit([X1, X2, X3], [y1, y2], batch_size=128, epochs=5)
However, I would like to provide the training data as a single tuple (x, y) in order to maintain compatibility with a custom data generator. When I do this, it throws an error:
data = ([X1, X2, X3], [y1, y2])
history = mymodel.fit(data, batch_size=128, epochs=5)
No gradients provided for any variable: ['dense/kernel:0', 'dense/bias:0',...
I guess my format for the data
tuple is wrong.
How can I correctly specify my training data?