简体   繁体   中英

tensorflow training endless when num epoch is set to None

I use the tf.estimator.inputs.numpy_input_fn to generate input function, and it is something like this:

train_input = tf.estimator.inputs.numpy_input_fn(x={'x': sst_train}, y=precip_train, shuffle=True, batch_size=100, num_epochs=None)

And the training process, I set up a for loop to control it. Here is the code:

for i in range(15):
est.train(input_fn=train_input, steps=20)

I think it should train 20*15 times in total, but it ends up with the endless loop. What's the problem here?

"num_epochs: Integer, number of epochs to iterate over data. If None will run forever.". You can see this in api comment of numpy_input_fn function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM