RuntimeError: `tf.data.Dataset` only supports Python-style iteration in eager mode or within tf.function.
please help with this error as I am not sure what to do
here is the offending line:
for input_example_batch, target_example_batch in dataset.take(1):
As per the doc, dataset.take(n)
returns another dataset, not a single batch. To actually get a batch out of that single-batch dataset, you can do
for input_example_batch, target_example_batch in next(iter(dataset.take(1))):