lingvo.trainer_impl module
Trainer.
To run locally:
$ bazel build -c opt //lingvo:trainer
$ bazel-bin/lingvo/trainer --logtostderr \
--model=image.mnist.LeNet5 --mode=sync --logdir=/tmp/lenet5 \
--run_locally=cpu
To use GPU, add --config=cuda
to build command and set --run_locally=gpu
.
- class lingvo.trainer_impl.Trainer(*args, **kwargs)[source]
Bases:
lingvo.base_runner.BaseRunner
Trainer on non-TPU.
- lingvo.trainer_impl._GetCheckpointIdForDecodeOut(ckpt_id_from_file, global_step)[source]
Retrieve the checkpoint id for the decoder out file.
Compares the checkpoint id found in the checkpoint file name to global step. If they diverge, uses the retrieved id and prints a warning.
- Parameters
ckpt_id_from_file – Checkpoint Id from the checkpoint file path.
global_step – int specifying the global step of the model.
- Returns
Checkpoint id as int.
- class lingvo.trainer_impl.Decoder(decoder_type, *args, **kwargs)[source]
Bases:
lingvo.base_runner.BaseRunner
Decoder.