I am trying to create an Input Layer using tf.keras.Input
using the type_spec argument to specify an input of DatasetSpec using Tensorflow's Functional API so that I can iterate over it later. If I try to define an input layer by specifying shape, I get error messages complaining that iterating over tf.tensor is not allowed.
X = np.random.uniform(size=(1000,75))
Y = np.random.uniform(size=(1000))
data = tf.data.Dataset.from_tensor_slices((X, Y))
data = data.batch(batch_size=100, drop_remainder=True)
input = tf.keras.Input(type_spec = tf.data.DatasetSpec.from_value(data))
I got the following error:
ValueError: KerasTensor only supports TypeSpecs that have a shape field; got DatasetSpec, which does not have a shape.