f3d79e3fe7f6450f804e8f41935b3e491a99f7e3,models/official/mnasnet/mnasnet_main.py,,,#,37

Before Change


          " TensorFlow by default (e.g. CPU and GPU)"))

// Cloud TPU Cluster Resolvers
flags.DEFINE_string(
    "tpu",
    default=None,
    help="The Cloud TPU to use for training. This should be either the name "
    "used when creating the Cloud TPU, or a grpc://ip.address.of.tpu:8470 url.")

flags.DEFINE_string(
    "gcp_project",
    default=None,
    help="Project name for the Cloud TPU-enabled project. If not specified, we "
    "will attempt to automatically detect the GCE project from metadata.")

flags.DEFINE_string(
    "tpu_zone",
    default=None,
    help="GCE zone where the Cloud TPU is located in. If not specified, we "
    "will attempt to automatically detect the GCE project from metadata.")

// Model specific flags
flags.DEFINE_string(
    "data_dir",
    default=FAKE_DATA_DIR,
    help=("The directory where the ImageNet input data is stored. Please see"
          " the README.md for the expected data format."))

flags.DEFINE_string(
    "model_dir",
    default=None,
    help=("The directory where the model and training/evaluation summaries are"
          " stored."))

flags.DEFINE_string(
    "model_name",
    default="mnasnet-a1",
    help=(
        "The model name to select models among existing MnasNet configurations."
    ))

flags.DEFINE_enum("mode", "train_and_eval",
                  ["train_and_eval", "train", "eval", "export_only"],
                  "One of {"train_and_eval", "train", "eval", "export_only"}.")

flags.DEFINE_integer(
    "train_steps",
    default=437898,
    help=("The number of steps to use for training. Default is 437898 steps"
          " which is approximately 350 epochs at batch size 1024. This flag"
          " should be adjusted according to the --train_batch_size flag."))

flags.DEFINE_integer("input_image_size", default=224, help="Input image size.")

flags.DEFINE_integer(
    "train_batch_size", default=1024, help="Batch size for training.")

flags.DEFINE_integer(
    "eval_batch_size", default=1024, help="Batch size for evaluation.")

flags.DEFINE_integer(
    "num_train_images", default=1281167, help="Size of training data set.")

flags.DEFINE_integer(
    "num_eval_images", default=50000, help="Size of evaluation data set.")

flags.DEFINE_integer(
    "steps_per_eval",
    default=6255,
    help=("Controls how often evaluation is performed. Since evaluation is"
          " fairly expensive, it is advised to evaluate as infrequently as"
          " possible (i.e. up to --train_steps, which evaluates the model only"
          " after finishing the entire training regime)."))

flags.DEFINE_integer(
    "eval_timeout",
    default=None,
    help="Maximum seconds between checkpoints before evaluation terminates.")

flags.DEFINE_bool(
    "skip_host_call",
    default=False,
    help=("Skip the host_call which is executed every training step. This is"
          " generally used for generating training summaries (train loss,"
          " learning rate, etc...). When --skip_host_call=false, there could"
          " be a performance drop if host_call function is slow and cannot"
          " keep up with the TPU-side computation."))

flags.DEFINE_integer(
    "iterations_per_loop",
    default=1251,
    help=("Number of steps to run on TPU before outfeeding metrics to the CPU."
          " If the number of iterations in the loop would exceed the number of"
          " train steps, the loop will exit before reaching"
          " --iterations_per_loop. The larger this value is, the higher the"
          " utilization on the TPU."))

flags.DEFINE_integer(
    "num_parallel_calls",
    default=64,

After Change


from tensorflow.python.keras import backend as K

common_tpu_flags.define_common_tpu_flags()
common_hparams_flags.define_common_hparams_flags()

FLAGS = flags.FLAGS

FAKE_DATA_DIR = "gs://cloud-tpu-test-datasets/fake_imagenet"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: tensorflow/tpu
Commit Name: f3d79e3fe7f6450f804e8f41935b3e491a99f7e3
Time: 2019-07-02
Author: gardener@tensorflow.org
File Name: models/official/mnasnet/mnasnet_main.py
Class Name:
Method Name:


Project Name: tensorflow/tpu
Commit Name: f3d79e3fe7f6450f804e8f41935b3e491a99f7e3
Time: 2019-07-02
Author: gardener@tensorflow.org
File Name: models/official/mnasnet/mnasnet_main.py
Class Name:
Method Name:


Project Name: tensorflow/tpu
Commit Name: 377dbd0c1dc2ac1cf90556e9a4a5ecccbfa65a93
Time: 2019-04-23
Author: allencwang@google.com
File Name: models/official/mobilenet/mobilenet.py
Class Name:
Method Name:


Project Name: tensorflow/tpu
Commit Name: 69d221deb018beed51b2f5216ca34c61cca92858
Time: 2019-07-03
Author: gardener@tensorflow.org
File Name: models/official/squeezenet/squeezenet_main.py
Class Name:
Method Name: