contrib.training.train
tf.contrib.training.train
tf.contrib.training.train
train( train_op, logdir, master='', is_chief=True, scaffold=None, hooks=None, chief_only_hooks=None, save_checkpoint_secs=600, save_summaries_steps=100, config=None )
Defined in tensorflow/contrib/training/python/training/training.py
.
Runs the training loop.
Args:
-
train_op
: ATensor
that, when executed, will apply the gradients and return the loss value. -
logdir
: The directory where the graph and checkpoints are saved. -
master
: The URL of the master. -
is_chief
: Specifies whether or not the training is being run by the primary replica during replica training. -
scaffold
: An tf.train.Scaffold instance. -
hooks
: List oftf.train.SessionRunHook
callbacks which are run inside the training loop. -
chief_only_hooks
: List oftf.train.SessionRunHook
instances which are run inside the training loop for the chief trainer only. -
save_checkpoint_secs
: The frequency, in seconds, that a checkpoint is saved using a default checkpoint saver. Ifsave_checkpoint_secs
is set toNone
, then the default checkpoint saver isn't used. -
save_summaries_steps
: The frequency, in number of global steps, that the summaries are written to disk using a default summary saver. Ifsave_summaries_steps
is set toNone
, then the default summary saver isn't used. -
config
: An instance oftf.ConfigProto
.
Returns:
the value of the loss function after training.
Raises:
-
ValueError
: iflogdir
isNone
and eithersave_checkpoint_secs
orsave_summaries_steps
are `None.
© 2017 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/contrib/training/train