eeee14a254adc199d5ee7baf002db3d73843fc8b,tools/datasets/imagenet_to_gcs.py,,main,#,441

Before Change


def main(argv):  // pylint: disable=unused-argument
  logging.set_verbosity(logging.INFO)

  if FLAGS.gcs_upload and FLAGS.project is None:
    raise ValueError("GCS Project must be provided.")

  if FLAGS.gcs_upload and FLAGS.gcs_output_path is None:
    raise ValueError("GCS output path must be provided.")
  elif FLAGS.gcs_upload and not FLAGS.gcs_output_path.startswith("gs://"):
    raise ValueError("GCS output path must start with gs://")

  if FLAGS.local_scratch_dir is None:
    raise ValueError("Scratch directory path must be provided.")

  // Download the dataset if it is not present locally
  raw_data_dir = FLAGS.raw_data_dir
  if raw_data_dir is None:
    raise AssertionError(
        "The ImageNet download path is no longer supported. Please download "
        "the .tar files manually and provide the `raw_data_dir`.")

  // Convert the raw data into tf-records
  training_records, validation_records = convert_to_tf_records(raw_data_dir)

  // Upload to GCS
  if FLAGS.gcs_upload:
    upload_to_gcs(training_records, validation_records)


if __name__ == "__main__":
  app.run(main)

After Change




def main(_):
  run(raw_data_dir=FLAGS.raw_data_dir,
      gcs_upload=FLAGS.gcs_upload,
      gcs_project=FLAGS.project,
      gcs_output_path=FLAGS.gcs_output_path,
      local_scratch_dir=FLAGS.local_scratch_dir)


if __name__ == "__main__":
  logging.set_verbosity(logging.INFO)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/tpu
Commit Name: eeee14a254adc199d5ee7baf002db3d73843fc8b
Time: 2020-07-20
Author: allencwang@google.com
File Name: tools/datasets/imagenet_to_gcs.py
Class Name:
Method Name: main


Project Name: facebookresearch/fastMRI
Commit Name: 05b2b1c02a8ce5f471877243ebebe5df876ccc37
Time: 2020-04-15
Author: tulliemurrell@gmail.com
File Name: models/unet/train_unet.py
Class Name:
Method Name: main


Project Name: MorvanZhou/Reinforcement-learning-with-tensorflow
Commit Name: 1a292afa66250814e3fa3fab26e4f7e5140baf31
Time: 2017-08-10
Author: morvanzhou@gmail.com
File Name: contents/12_Proximal_Policy_Optimization/simply_PPO.py
Class Name: PPO
Method Name: update


Project Name: GoogleCloudPlatform/ml-on-gcp
Commit Name: b0207dc0cac04995271f030608d0f6ff8e8039d3
Time: 2019-08-08
Author: yuhanliu@google.com
File Name: example_zoo/tools/cmle_package.py
Class Name: CMLEPackage
Method Name: generate