close

[Solved] tensorflow:Your input ran out of data

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error tensorflow:Your input ran out of data in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How tensorflow:Your input ran out of data Error Occurs?

Today I get the following error tensorflow:Your input ran out of data in Python.

How To Solve tensorflow:Your input ran out of data Error ?

  1. How To Solve tensorflow:Your input ran out of data Error ?

    To Solve tensorflow:Your input ran out of data Error I had same problem and decreasing validation_steps from 50 to 10 solved the issue.

Solution 1

To make sure that you have “at least steps_per_epoch * epochs batches“, set the steps_per_epoch to

steps_per_epoch = len(X_train)//batch_size
validation_steps = len(X_test)//batch_size # if you have test data

Then, there will be enough data for every epoch. Importantly, keep in mind that by default, batch_size is 32 in model.fit().

If you’re using a tf.data.Dataset, you can also add the repeat() method, but be careful: it will loop indefinitely (unless you specify a number).

Solution 2

I had same problem and decreasing validation_steps from 50 to 10 solved the issue.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment