I am building a model which is supposed to be a composition of different models. I need the output of one model to be fed as input to another. To do so, I followed the standard approach of extending tf.keras.Model and modifying the call() function suitably. However, that didn’t work out since Model2 expects an input of the type np.ndarray whereas Model1 returns an output of the type tf.tensor hence their composition isn’t possible.
I have tried multiple ways of doing the above including converting the tensor to a tf.Variable and using the Variable.assign() method, writing out values to a list and then using np.stack() to get a np.tensor as output. Nothing has worked so far.
I request the community to kindly help me out in solving the above issue.