tf.contrib.training.train
Stay organized with collections
Save and categorize content based on your preferences.
Runs the training loop.
tf.contrib.training.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, max_wait_secs=7200, run_metadata=None
)
Args |
train_op
|
A Tensor 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.compat.v1.train.Scaffold instance.
|
hooks
|
List of tf.estimator.SessionRunHook callbacks which are run inside
the training loop.
|
chief_only_hooks
|
List of tf.estimator.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. If save_checkpoint_secs is set to
None , 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. If
save_summaries_steps is set to None , then the default summary saver
isn't used.
|
config
|
An instance of tf.compat.v1.ConfigProto .
|
max_wait_secs
|
Maximum time workers should wait for the session to become
available. This should be kept relatively short to help detect incorrect
code, but sometimes may need to be increased if the chief takes a while to
start up.
|
run_metadata
|
A [RunMetadata ] protocol buffer.
|
Returns |
the value of the loss function after training.
|
Raises |
ValueError
|
if logdir is None and either save_checkpoint_secs or
save_summaries_steps are `None.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]