yuxiaomu1124
yuxiaomu1124
2019-06-24 16:00
采纳率: 33.3%
浏览 1.0k

我是新手,这个问题能帮我看看吗

ef parse_args():

parser = argparse.ArgumentParser(description='Basic statistics on tfrecord files')

parser.add_argument('--dataset_path', dest='dataset_path',
                    help='Path to the dataset json file.', type=str,
                    required=True)

parser.add_argument('--prefix', dest='dataset_name',
                    help='Prefix for the tfrecords (e.g. `train`, `test`, `val`).', type=str,
                    required=True)

parser.add_argument('--output_dir', dest='output_dir',
                    help='Directory for the tfrecords.', type=str,
                    required=True)

parser.add_argument('--shards', dest='num_shards',
                    help='Number of shards to make.', type=int,
                    required=True)

parser.add_argument('--threads', dest='num_threads',
                    help='Number of threads to make.', type=int,
                    required=True)

parser.add_argument('--shuffle', dest='shuffle',
                    help='Shuffle the records before saving them.',
                    required=False, action='store_true', default=False)

parser.add_argument('--store_images', dest='store_images',
                    help='Store the images in the tfrecords.',
                    required=False, action='store_true', default=False)

parsed_args = parser.parse_args()

return parsed_args





    错误提示:usage: create_tfrecords.py [-h] --dataset_path DATASET_PATH --prefix
                       DATASET_NAME --output_dir OUTPUT_DIR --shards
                       NUM_SHARDS --threads NUM_THREADS [--shuffle]
                       [--store_images]

create_tfrecords.py: error: the following arguments are required: --dataset_path, --prefix, --output_dir, --shards, --threads

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • qq_39412061
    吃鸡王者 2019-06-24 16:14
    已采纳

    在运行的时候这些参数是必须设定的,你没设定-dataset_path, --prefix, --output_dir, --shards, --threads 这个参数

    点赞 评论

相关推荐