MCPcopy Index your code
hub / github.com/tensorflow/models / test_already_trained_model

Method test_already_trained_model

orbit/controller_test.py:538–557  ·  view source on GitHub ↗
(self, enable_async_checkpoint_saving)

Source from the content-addressed store, hash-verified

536 ("_async_checkpoint_saving", True)
537 )
538 def test_already_trained_model(self, enable_async_checkpoint_saving):
539 test_runner = TestRunner()
540 test_runner.global_step.assign(10)
541
542 checkpoint = tf.train.Checkpoint(
543 model=test_runner.model, optimizer=test_runner.optimizer)
544 checkpoint_manager = tf.train.CheckpointManager(
545 checkpoint,
546 self.model_dir,
547 max_to_keep=None,
548 step_counter=test_runner.global_step,
549 checkpoint_interval=10)
550 test_controller = controller.Controller(
551 trainer=test_runner,
552 global_step=test_runner.global_step,
553 steps_per_loop=2,
554 checkpoint_manager=checkpoint_manager,
555 enable_async_checkpointing=enable_async_checkpoint_saving)
556 # `global_step` is already `train_steps`.
557 test_controller.train(steps=10)
558
559 def test_summaries_inside_train_fn(self):
560 test_runner = TestTrainerWithSummaries()

Callers

nothing calls this directly

Calls 3

trainMethod · 0.95
TestRunnerClass · 0.85
assignMethod · 0.45

Tested by

no test coverage detected