當前位置: 首頁>>代碼示例>>Python>>正文


Python imagenet_data.ImagenetData方法代碼示例

本文整理匯總了Python中inception.imagenet_data.ImagenetData方法的典型用法代碼示例。如果您正苦於以下問題:Python imagenet_data.ImagenetData方法的具體用法?Python imagenet_data.ImagenetData怎麽用?Python imagenet_data.ImagenetData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在inception.imagenet_data的用法示例。


在下文中一共展示了imagenet_data.ImagenetData方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(_):
  dataset = ImagenetData(subset=FLAGS.subset)
  assert dataset.data_files()
  if tf.gfile.Exists(FLAGS.train_dir):
    tf.gfile.DeleteRecursively(FLAGS.train_dir)
  tf.gfile.MakeDirs(FLAGS.train_dir)
  inception_train.train(dataset) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:9,代碼來源:imagenet_train.py

示例2: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_args):
  assert FLAGS.job_name in ['ps', 'worker'], 'job_name must be ps or worker'

  # Extract all the hostnames for the ps and worker jobs to construct the
  # cluster spec.
  ps_hosts = FLAGS.ps_hosts.split(',')
  worker_hosts = FLAGS.worker_hosts.split(',')
  tf.logging.info('PS hosts are: %s' % ps_hosts)
  tf.logging.info('Worker hosts are: %s' % worker_hosts)

  cluster_spec = tf.train.ClusterSpec({'ps': ps_hosts,
                                       'worker': worker_hosts})
  server = tf.train.Server(
      {'ps': ps_hosts,
       'worker': worker_hosts},
      job_name=FLAGS.job_name,
      task_index=FLAGS.task_id,
      protocol=FLAGS.protocol)

  if FLAGS.job_name == 'ps':
    # `ps` jobs wait for incoming connections from the workers.
    server.join()
  else:
    # `worker` jobs will actually do the work.
    dataset = ImagenetData(subset=FLAGS.subset)
    assert dataset.data_files()
    # Only the chief checks for or creates train_dir.
    if FLAGS.task_id == 0:
      if not tf.gfile.Exists(FLAGS.train_dir):
        tf.gfile.MakeDirs(FLAGS.train_dir)
    inception_distributed_train.train(server.target, dataset, cluster_spec) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:33,代碼來源:imagenet_distributed_train.py

示例3: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_argv=None):
  dataset = ImagenetData(subset=FLAGS.subset)
  assert dataset.data_files()
  if tf.gfile.Exists(FLAGS.eval_dir):
    tf.gfile.DeleteRecursively(FLAGS.eval_dir)
  tf.gfile.MakeDirs(FLAGS.eval_dir)
  inception_eval.evaluate(dataset) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:9,代碼來源:imagenet_eval.py

示例4: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_args):
  assert FLAGS.job_name in ['ps', 'worker'], 'job_name must be ps or worker'

  # Extract all the hostnames for the ps and worker jobs to construct the
  # cluster spec.
  ps_hosts = FLAGS.ps_hosts.split(',')
  worker_hosts = FLAGS.worker_hosts.split(',')
  tf.logging.info('PS hosts are: %s' % ps_hosts)
  tf.logging.info('Worker hosts are: %s' % worker_hosts)

  cluster_spec = tf.train.ClusterSpec({'ps': ps_hosts,
                                       'worker': worker_hosts})
  server = tf.train.Server(
      {'ps': ps_hosts,
       'worker': worker_hosts},
      job_name=FLAGS.job_name,
      task_index=FLAGS.task_id)

  if FLAGS.job_name == 'ps':
    # `ps` jobs wait for incoming connections from the workers.
    server.join()
  else:
    # `worker` jobs will actually do the work.
    dataset = ImagenetData(subset=FLAGS.subset)
    assert dataset.data_files()
    # Only the chief checks for or creates train_dir.
    if FLAGS.task_id == 0:
      if not tf.gfile.Exists(FLAGS.train_dir):
        tf.gfile.MakeDirs(FLAGS.train_dir)
    inception_distributed_train.train(server.target, dataset, cluster_spec) 
開發者ID:Cyber-Neuron,項目名稱:inception_v3,代碼行數:32,代碼來源:imagenet_distributed_train.py

示例5: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(_):
  dataset = ImagenetData(subset=FLAGS.subset)
  #assert dataset.data_files()
  if tf.gfile.Exists(FLAGS.train_dir):
    tf.gfile.DeleteRecursively(FLAGS.train_dir)
  tf.gfile.MakeDirs(FLAGS.train_dir)
  inception_train.train(dataset) 
開發者ID:awslabs,項目名稱:deeplearning-benchmark,代碼行數:9,代碼來源:imagenet_train.py

示例6: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_args):
  assert FLAGS.job_name in ['ps', 'worker'], 'job_name must be ps or worker'

  # Extract all the hostnames for the ps and worker jobs to construct the
  # cluster spec.
  ps_hosts = FLAGS.ps_hosts.split(',')
  worker_hosts = FLAGS.worker_hosts.split(',')
  tf.logging.info('PS hosts are: %s' % ps_hosts)
  tf.logging.info('Worker hosts are: %s' % worker_hosts)

  cluster_spec = tf.train.ClusterSpec({'ps': ps_hosts,
                                       'worker': worker_hosts})
  server = tf.train.Server(
      {'ps': ps_hosts,
       'worker': worker_hosts},
      job_name=FLAGS.job_name,
      task_index=FLAGS.task_id)

  if FLAGS.job_name == 'ps':
    # `ps` jobs wait for incoming connections from the workers.
    server.join()
  else:
    # `worker` jobs will actually do the work.
    dataset = ImagenetData(subset=FLAGS.subset)
    #assert dataset.data_files()
    # Only the chief checks for or creates train_dir.
    if FLAGS.task_id == 0:
      if not tf.gfile.Exists(FLAGS.train_dir):
        tf.gfile.MakeDirs(FLAGS.train_dir)
    inception_distributed_train.train(server.target, dataset, cluster_spec) 
開發者ID:awslabs,項目名稱:deeplearning-benchmark,代碼行數:32,代碼來源:imagenet_distributed_train.py

示例7: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(_):
  dataset = ImagenetData(subset=FLAGS.subset)
  assert dataset.data_files()
  if tf.gfile.Exists(FLAGS.train_dir):
    tf.gfile.DeleteRecursively(FLAGS.train_dir)
  tf.gfile.MakeDirs(FLAGS.train_dir)
  FLAGS.dataset_name = 'imagenet'
  inception_train.train(dataset) 
開發者ID:wenwei202,項目名稱:terngrad,代碼行數:10,代碼來源:imagenet_train.py

示例8: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_args):
  FLAGS.dataset_name = 'imagenet'

  assert FLAGS.job_name in ['ps', 'worker'], 'job_name must be ps or worker'

  # Extract all the hostnames for the ps and worker jobs to construct the
  # cluster spec.
  ps_hosts = FLAGS.ps_hosts.split(',')
  worker_hosts = FLAGS.worker_hosts.split(',')
  tf.logging.info('PS hosts are: %s' % ps_hosts)
  tf.logging.info('Worker hosts are: %s' % worker_hosts)

  cluster_spec = tf.train.ClusterSpec({'ps': ps_hosts,
                                       'worker': worker_hosts})
  sess_config = tf.ConfigProto()
  sess_config.gpu_options.allow_growth = True

  server = tf.train.Server(
      {'ps': ps_hosts,
       'worker': worker_hosts},
      job_name=FLAGS.job_name,
      task_index=FLAGS.task_id,
      config=sess_config)

  if FLAGS.job_name == 'ps':
    # `ps` jobs wait for incoming connections from the workers.
    server.join()
  else:
    # `worker` jobs will actually do the work.
    dataset = ImagenetData(subset=FLAGS.subset)
    assert dataset.data_files()
    # Only the chief checks for or creates train_dir.
    if FLAGS.task_id == 0:
      if not tf.gfile.Exists(FLAGS.train_dir):
        tf.gfile.MakeDirs(FLAGS.train_dir)
    inception_distributed_train.train(server.target, dataset, cluster_spec) 
開發者ID:wenwei202,項目名稱:terngrad,代碼行數:38,代碼來源:imagenet_distributed_train.py

示例9: main

# 需要導入模塊: from inception import imagenet_data [as 別名]
# 或者: from inception.imagenet_data import ImagenetData [as 別名]
def main(unused_argv=None):
  dataset = ImagenetData(subset=FLAGS.subset)
  assert dataset.data_files()
  if tf.gfile.Exists(FLAGS.eval_dir):
    tf.gfile.DeleteRecursively(FLAGS.eval_dir)
  tf.gfile.MakeDirs(FLAGS.eval_dir)
  FLAGS.dataset_name = 'imagenet'
  FLAGS.num_examples = dataset.num_examples_per_epoch()
  inception_eval.evaluate(dataset) 
開發者ID:wenwei202,項目名稱:terngrad,代碼行數:11,代碼來源:imagenet_eval.py


注:本文中的inception.imagenet_data.ImagenetData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。