df89d3e02a41e34581e8065cf5868a9570fa3010,research/delf/delf/python/training/train.py,,main,#Any#,106

Before Change


  validation_iterator = strategy.make_dataset_iterator(validation_dataset)

  train_iterator.initialize()
  validation_iterator.initialize()

  // Create a checkpoint directory to store the checkpoints.
  checkpoint_prefix = os.path.join(FLAGS.logdir, "delf_tf2-ckpt")

After Change



        // TODO(dananghel): try to load pretrained weights at backbone creation.
        // Load pretrained weights for ResNet50 trained on ImageNet.
        if FLAGS.imagenet_checkpoint is not None:
          logging.info("Attempting to load ImageNet pretrained weights.")
          input_batch = next(train_iter)
          _, _ = distributed_train_step(input_batch)
          model.backbone.restore_weights(FLAGS.imagenet_checkpoint)
          logging.info("Done.")
        else:
          logging.info("Skip loading ImageNet pretrained weights.")
        if FLAGS.debug:
          model.backbone.log_weights()

        global_step_value = optimizer.iterations.numpy()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: tensorflow/models
Commit Name: df89d3e02a41e34581e8065cf5868a9570fa3010
Time: 2020-06-30
Author: bfusinska@google.com
File Name: research/delf/delf/python/training/train.py
Class Name:
Method Name: main


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 848d8b1e70d3f85304476518c9bd5440825ecf73
Time: 2019-07-12
Author: guillaume.klein@systrangroup.com
File Name: examples/library/minimal_transformer_training.py
Class Name:
Method Name: main


Project Name: tensorflow/models
Commit Name: df89d3e02a41e34581e8065cf5868a9570fa3010
Time: 2020-06-30
Author: bfusinska@google.com
File Name: research/delf/delf/python/training/train.py
Class Name:
Method Name: main


Project Name: shibing624/pycorrector
Commit Name: 5341cc169bcbd771cf2ea413424eb28f2431fe68
Time: 2019-12-20
Author: xuming624@qq.com
File Name: pycorrector/transformer/infer.py
Class Name:
Method Name: