[Tensorflow] 使用 tf.keras.utils.get_file() 下载 MS-COCO 2014 数据集
import argparse import tensorflow as tf
tf.enable_eager_execution() def main(args):
"""Download the Microsoft COCO 2014 data set."""
# Annotation zip
tf.keras.utils.get_file(fname=args.annotation_zip,
origin=args.annotation_origin,
cache_dir=args.cache_dir,
cache_subdir=args.cache_subdir,
extract=True) # Train image zip
tf.keras.utils.get_file(fname=args.train_zip,
origin=args.train_origin,
cache_dir=args.cache_dir,
cache_subdir=args.cache_subdir,
extract=True) # Val image zip
tf.keras.utils.get_file(fname=args.val_zip,
origin=args.val_origin,
cache_dir=args.cache_dir,
cache_subdir=args.cache_subdir,
extract=True) # Test image zip
tf.keras.utils.get_file(fname=args.test_zip,
origin=args.test_origin,
cache_dir=args.cache_dir,
cache_subdir=args.cache_subdir,
extract=True) if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--cache_dir', type=str, default='F:/', help='location to store cached files')
parser.add_argument('--cache_subdir', type=str, default='COCO2014/', help='subdirectory under the cache dir')
parser.add_argument('--annotation_zip', type=str, default='annotation2014.zip', help='name of annotation zip')
parser.add_argument('--annotation_origin', type=str,
default='http://images.cocodataset.org/annotations/annotations_trainval2014.zip',
help='origin of annotation zip')
parser.add_argument('--train_zip', type=str, default='train2014.zip', help='name of train zip')
parser.add_argument('--train_origin', type=str,
default='http://images.cocodataset.org/zips/train2014.zip',
help='origin of train zip')
parser.add_argument('--val_zip', type=str, default='val2014.zip', help='name of val zip')
parser.add_argument('--val_origin', type=str,
default='http://images.cocodataset.org/zips/val2014.zip',
help='origin of val zip')
parser.add_argument('--test_zip', type=str, default='test2014.zip', help='name of test zip')
parser.add_argument('--test_origin', type=str,
default='http://images.cocodataset.org/zips/test2014.zip',
help='origin of test zip') args = parser.parse_args()
print(args) main(args)
[Tensorflow] 使用 tf.keras.utils.get_file() 下载 MS-COCO 2014 数据集的更多相关文章
- Tensorflow2(一)深度学习基础和tf.keras
代码和其他资料在 github 一.tf.keras概述 首先利用tf.keras实现一个简单的线性回归,如 \(f(x) = ax + b\),其中 \(x\) 代表学历,\(f(x)\) 代表收入 ...
- 【tf.keras】TensorFlow 1.x 到 2.0 的 API 变化
TensorFlow 2.0 版本将 keras 作为高级 API,对于 keras boy/girl 来说,这就很友好了.tf.keras 从 1.x 版本迁移到 2.0 版本,需要修改几个地方. ...
- 【tf.keras】tensorflow datasets,tfds
一些最常用的数据集如 MNIST.Fashion MNIST.cifar10/100 在 tf.keras.datasets 中就能找到,但对于其它也常用的数据集如 SVHN.Caltech101,t ...
- 【tf.keras】tf.keras使用tensorflow中定义的optimizer
Update:2019/09/21 使用 tf.keras 时,请使用 tf.keras.optimizers 里面的优化器,不要使用 tf.train 里面的优化器,不然学习率衰减会出现问题. 使用 ...
- [Tensorflow] 使用 tf.train.Checkpoint() 保存 / 加载 keras subclassed model
在 subclassed_model.py 中,通过对 tf.keras.Model 进行子类化,设计了两个自定义模型. import tensorflow as tf tf.enable_eager ...
- tensorflow 2.0 技巧 | 自定义tf.keras.Model的坑
自定义tf.keras.Model需要注意的点 model.save() subclass Model 是不能直接save的,save成.h5,但是能够save_weights,或者save_form ...
- 如何使用keras加载下载好的数据集
https://blog.csdn.net/houchaoqun_xmu/article/details/78492718 [keras]解决 example 案例中 MNIST 数据集下载不了的问题 ...
- TensorFlow2.0(11):tf.keras建模三部曲
.caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px so ...
- 【tf.keras】在 cifar 上训练 AlexNet,数据集过大导致 OOM
cifar-10 每张图片的大小为 32×32,而 AlexNet 要求图片的输入是 224×224(也有说 227×227 的,这是 224×224 的图片进行大小为 2 的 zero paddin ...
随机推荐
- 牛客算法:DNA序列
import java.util.*; public class Main{ public static void main(String[] args){ try(Scanner in = new ...
- Checklist的补充规则
常见问题: 1.什么时候该补充Checklist? 2.Checklist应该写哪些用例? 3.自己写的模块是否自己执行? 4.什么时候执行Checklist? 5.执行完Checklist大概需要花 ...
- Java并发包--ConcurrentLinkedQueue
转载请注明出处:http://www.cnblogs.com/skywang12345/p/3498995.html ConcurrentLinkedQueue介绍 ConcurrentLinkedQ ...
- 表单文本字段预期描述(placeholder="请输入产品名称"以及prompt:'输入价格')
普通html文本标签设置: <input id="xxx" placeholder="请输入产品名称"/> 带有jQueryEasyUI插件的htm ...
- [cf1138BCircus][枚举,列等式]
https://codeforc.es/contest/1138/problem/B B. Circus time limit per test 1 second memory limit per t ...
- Bluetooth M590 mouse problem Ubuntu
I restart it in the terminal, and it works: Code: $ sudo -i # bluetoothctl [bluetooth]# power off [b ...
- Shell基本语法知识
Shell 就是一个命令解释器,他的作用就是解释执行用户输入的命令及程序等,用户每输入一条命令,Shell 就解释一条.这种从键盘一输入命令,就可以立即得到回应的对话方式,就称为交互的方式. 当命令或 ...
- Vue2 响应式原理
我们经常用vue的双向绑定,改变data的某个属性值,vue就马上帮我们自动更新视图,下面我们看看原理. Object的响应式原理: 可以看到,其实核心就是把object的所有属性都加上getter. ...
- oc Learning Blog
http://www.cnblogs.com/heyonggang/p/3351269.html M了个J :http://www.cnblogs.com/mjios/tag/objective-c/ ...
- POJ 3616 Milking Time ——(记忆化搜索)
第一眼看是线段交集问题,感觉不会= =.然后发现n是1000,那好像可以n^2建图再做.一想到这里,突然醒悟,直接记忆化搜索就好了啊..太蠢了.. 代码如下: #include <stdio.h ...