When trying to transfer learn from a prebuilt model on tensorflow hub i have tried putting it into a model within the functional model API due to its dictionary input. However when doing this it seems to not recognize tensorflow_hub.keras_layer.KerasLayer as a Tensorflow layer. All of the support on transfer learning from tensorflow hub seems to suggest putting it into a Sequential() model which is not an option with the Input spec. Is there any way to resolve this?
import tensorflow as tf
import tensorflow_hub as hub
input_shape = {'time': tf.keras.Input(shape=(None, 1), dtype=tf.float32, name='time'),
'x0': tf.keras.Input(shape=(None, None, None, 3), dtype=tf.float32, name='x0'),
'x1': tf.keras.Input(shape=(None, None, None, 3), dtype=tf.float32, name='x1')}
outputs = hub.KerasLayer("https://tfhub.dev/google/film/1")
outputs.build(input_shape=input_shape)
model = tf.keras.Model(inputs=input_shape, outputs=outputs)
model.summary()
Have tried using TensorSpecs for the input as well as converting the keras layer to a tensorflow layer but nothing i have tried seems to work.