Search code examples
tensorflowkerastf.data.dataset

Keras predictions on tf.data dataset doesn't stop


I have run into a problem with using a generator to do predictions for my model. According to the documentation if steps = None predict should run through the whole dataset. But instead, it goes passed it and I starts again. I'm using flow_from_dataframe on an image dataset.

Should I fix the step size to ceil(len(dataset) / batch_size)?

thanks in advance!


Solution

  • Hmm, well it's not a real solution, but fixing the stepsize to the length of the dataset did it. I guess the docs have to be updated.