W3cubDocs

/TensorFlow Python

tf.train.basic_train_loop

tf.train.basic_train_loop(
    supervisor,
    train_step_fn,
    args=None,
    kwargs=None,
    master=''
)

Defined in tensorflow/python/training/basic_loops.py.

See the guide: Training > Training Utilities

Basic loop to train a model.

Calls train_step_fn in a loop to train a model. The function is called as:

train_step_fn(session, *args, **kwargs)

It is passed a tf.Session in addition to args and kwargs. The function typically runs one training step in the session.

Args:

  • supervisor: tf.train.Supervisor to run the training services.
  • train_step_fn: Callable to execute one training step. Called repeatedly as train_step_fn(session, *args **kwargs).
  • args: Optional positional arguments passed to train_step_fn.
  • kwargs: Optional keyword arguments passed to train_step_fn.
  • master: Master to use to create the training session. Defaults to "" which causes the session to be created in the local process.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/train/basic_train_loop