Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曾经的那一瞬间
Models
提交
a86917df
M
Models
项目概览
曾经的那一瞬间
/
Models
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a86917df
编写于
2月 16, 2021
作者:
A
A. Unique TensorFlower
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Internal change
PiperOrigin-RevId: 357758634
上级
2fb3c898
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
567 addition
and
37 deletion
+567
-37
official/vision/beta/MODEL_GARDEN.md
official/vision/beta/MODEL_GARDEN.md
+21
-11
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs101_i160.yaml
...ments/image_classification/imagenet_resnetrs101_i160.yaml
+16
-8
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs101_i192.yaml
...ments/image_classification/imagenet_resnetrs101_i192.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs152_i192.yaml
...ments/image_classification/imagenet_resnetrs152_i192.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs152_i224.yaml
...ments/image_classification/imagenet_resnetrs152_i224.yaml
+16
-5
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs152_i256.yaml
...ments/image_classification/imagenet_resnetrs152_i256.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs200_i256.yaml
...ments/image_classification/imagenet_resnetrs200_i256.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs270_i256.yaml
...ments/image_classification/imagenet_resnetrs270_i256.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs350_i256.yaml
...ments/image_classification/imagenet_resnetrs350_i256.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs350_i320.yaml
...ments/image_classification/imagenet_resnetrs350_i320.yaml
+61
-0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs420_i320.yaml
...ments/image_classification/imagenet_resnetrs420_i320.yaml
+11
-7
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs50_i160.yaml
...iments/image_classification/imagenet_resnetrs50_i160.yaml
+61
-0
official/vision/beta/configs/image_classification.py
official/vision/beta/configs/image_classification.py
+10
-5
official/vision/beta/dataloaders/classification_input.py
official/vision/beta/dataloaders/classification_input.py
+4
-1
official/vision/beta/tasks/image_classification.py
official/vision/beta/tasks/image_classification.py
+1
-0
未找到文件。
official/vision/beta/MODEL_GARDEN.md
浏览文件 @
a86917df
...
...
@@ -6,7 +6,7 @@ TF Vision model garden provides a large collection of baselines and checkpoints
## Image Classification
### ImageNet Baselines
####
M
odels trained with vanilla settings:
####
ResNet m
odels trained with vanilla settings:
*
Models are trained from scratch with batch size 4096 and 1.6 initial learning rate.
*
Linear warmup is applied for the first 5 epochs.
*
Models trained with l2 weight regularization and ReLU activation.
...
...
@@ -18,17 +18,27 @@ TF Vision model garden provides a large collection of baselines and checkpoints
| ResNet-101 | 224x224 | 200 | 78.3 | 94.2 | config |
| ResNet-152 | 224x224 | 200 | 78.7 | 94.3 | config |
#### Models trained with training features including:
*
Label smoothing 0.1.
*
Swish activation.
| model | resolution | epochs | Top-1 | Top-5 | download |
| ------------ |:-------------:| ---------:|--------:|---------:|---------:|
| ResNet-50 | 224x224 | 200 | 78.1 | 93.9 |
[
config
](
https://github.com/tensorflow/models/blob/master/official/vision/beta/configs/experiments/image_classification/imagenet_resnet50_tpu.yaml
)
|
| ResNet-101 | 224x224 | 200 | 79.1 | 94.5 |
[
config
](
https://github.com/tensorflow/models/blob/master/official/vision/beta/configs/experiments/image_classification/imagenet_resnet101_tpu.yaml
)
|
| ResNet-152 | 224x224 | 200 | 79.4 | 94.7 |
[
config
](
https://github.com/tensorflow/models/blob/master/official/vision/beta/configs/experiments/image_classification/imagenet_resnet152_tpu.yaml
)
|
| ResNet-200 | 224x224 | 200 | 79.9 | 94.8 |
[
config
](
https://github.com/tensorflow/models/blob/master/official/vision/beta/configs/experiments/image_classification/imagenet_resnet200_tpu.yaml
)
|
#### ResNet-RS models trained with settings including:
*
ResNet-RS architectural changes and Swish activation.
*
Regularization methods including Random Augment, 4e-5 weight decay, stochastic depth, label smoothing and dropout.
*
New training methods including a 350-epoch schedule, cosine learning rate and
EMA.
*
Configs are in this
[
directory
](
https://github.com/tensorflow/models/blob/master/official/vision/beta/configs/experiments/image_classification
)
model | resolution | params (M) | Top-1 | Top-5 | download
--------- | :--------: | -----: | ----: | ----: | -------:
ResNet-RS-50 | 160x160 | 35.7 | 79.1 | 94.5 |
ResNet-RS-101 | 160x160 | 63.7 | 80.2 | 94.9 |
ResNet-RS-101 | 192x192 | 63.7 | 81.3 | 95.6 |
ResNet-RS-152 | 192x192 | 86.8 | 81.9 | 95.8 |
ResNet-RS-152 | 224x224 | 86.8 | 82.5 | 96.1 |
ResNet-RS-152 | 256x256 | 86.8 | 83.1 | 96.3 |
ResNet-RS-200 | 256x256 | 93.4 | 83.5 | 96.6 |
ResNet-RS-270 | 256x256 | 130.1 | 83.6 | 96.6 |
ResNet-RS-350 | 256x256 | 164.3 | 83.7 | 96.7 |
ResNet-RS-350 | 320x320 | 164.3 | 84.2 | 96.9 |
## Object Detection and Instance Segmentation
...
...
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
300_tpu
.yaml
→
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
rs101_i160
.yaml
浏览文件 @
a86917df
# ResNet-
300 ImageNet classification. 82.6% top-1 and 96.3% top-5
accuracy.
# ResNet-
RS-101 ImageNet classification. 80.2%
accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
380
,
38
0
,
3
]
input_size
:
[
160
,
16
0
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
300
stem_type
:
'
v1'
model_id
:
101
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stochastic_depth_drop_rate
:
0.2
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.000
1
l2_weight_decay
:
0.000
04
one_hot
:
true
label_smoothing
:
0.1
train_data
:
...
...
@@ -24,6 +28,8 @@ task:
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
...
...
@@ -31,13 +37,15 @@ task:
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
624
00
train_steps
:
1092
00
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
...
...
@@ -46,7 +54,7 @@ trainer:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
624
00
decay_steps
:
1092
00
warmup
:
type
:
'
linear'
linear
:
...
...
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs101_i192.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-101 ImageNet classification. 81.3% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
192
,
192
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
101
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs152_i192.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-152 ImageNet classification. 81.9% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
192
,
192
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
152
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
200_tpu
.yaml
→
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
rs152_i224
.yaml
浏览文件 @
a86917df
# ResNet-
200 ImageNet classification. 79.9% top-1 and 94.8
% top-5 accuracy.
# ResNet-
RS-152 ImageNet classification. 82.5
% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
...
...
@@ -9,11 +9,18 @@ task:
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
200
model_id
:
152
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.000
1
l2_weight_decay
:
0.000
04
one_hot
:
true
label_smoothing
:
0.1
train_data
:
...
...
@@ -21,6 +28,8 @@ task:
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
...
...
@@ -28,13 +37,15 @@ task:
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
624
00
train_steps
:
1092
00
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
...
...
@@ -43,7 +54,7 @@ trainer:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
624
00
decay_steps
:
1092
00
warmup
:
type
:
'
linear'
linear
:
...
...
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs152_i256.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-152 ImageNet classification. 83.1% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
256
,
256
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
152
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs200_i256.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-200 ImageNet classification. 83.5% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
256
,
256
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
200
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.1
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs270_i256.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-270 ImageNet classification. 83.6% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
256
,
256
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
270
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.1
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs350_i256.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-350 ImageNet classification. 83.7% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
256
,
256
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
350
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.1
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs350_i320.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-350 ImageNet classification. 84.2% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
320
,
320
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
350
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.1
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
350_tpu
.yaml
→
official/vision/beta/configs/experiments/image_classification/imagenet_resnet
rs420_i320
.yaml
浏览文件 @
a86917df
# ResNet-350 ImageNet classification. 84.2% top-1 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
...
...
@@ -9,14 +8,16 @@ task:
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
35
0
depth_multiplier
:
1.25
stem_type
:
'
v1'
model_id
:
42
0
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stochastic_depth_drop_rate
:
0.2
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.1
norm_activation
:
activation
:
'
swish'
dropout_rate
:
0.5
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
...
...
@@ -27,6 +28,7 @@ task:
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
15
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
...
...
@@ -41,6 +43,8 @@ trainer:
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
...
...
@@ -53,4 +57,4 @@ trainer:
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
500
0
warmup_steps
:
156
0
official/vision/beta/configs/experiments/image_classification/imagenet_resnetrs50_i160.yaml
0 → 100644
浏览文件 @
a86917df
# ResNet-RS-50 ImageNet classification. 79.1% top-5 accuracy.
runtime
:
distribution_strategy
:
'
tpu'
mixed_precision_dtype
:
'
bfloat16'
task
:
model
:
num_classes
:
1001
input_size
:
[
160
,
160
,
3
]
backbone
:
type
:
'
resnet'
resnet
:
model_id
:
50
replace_stem_max_pool
:
true
resnetd_shortcut
:
true
se_ratio
:
0.25
stem_type
:
'
v1'
stochastic_depth_drop_rate
:
0.0
norm_activation
:
activation
:
'
swish'
norm_momentum
:
0.0
use_sync_bn
:
false
losses
:
l2_weight_decay
:
0.00004
one_hot
:
true
label_smoothing
:
0.1
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
true
global_batch_size
:
4096
dtype
:
'
bfloat16'
aug_policy
:
'
randaug'
randaug_magnitude
:
10
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
false
global_batch_size
:
4096
dtype
:
'
bfloat16'
drop_remainder
:
false
trainer
:
train_steps
:
109200
validation_steps
:
13
validation_interval
:
312
steps_per_loop
:
312
summary_interval
:
312
checkpoint_interval
:
312
optimizer_config
:
ema
:
average_decay
:
0.9999
optimizer
:
type
:
'
sgd'
sgd
:
momentum
:
0.9
learning_rate
:
type
:
'
cosine'
cosine
:
initial_learning_rate
:
1.6
decay_steps
:
109200
warmup
:
type
:
'
linear'
linear
:
warmup_steps
:
1560
official/vision/beta/configs/image_classification.py
浏览文件 @
a86917df
...
...
@@ -35,6 +35,7 @@ class DataConfig(cfg.DataConfig):
shuffle_buffer_size
:
int
=
10000
cycle_length
:
int
=
10
aug_policy
:
Optional
[
str
]
=
None
# None, 'autoaug', or 'randaug'
randaug_magnitude
:
Optional
[
int
]
=
10
file_type
:
str
=
'tfrecord'
...
...
@@ -184,13 +185,17 @@ def image_classification_imagenet_resnetrs() -> cfg.ExperimentConfig:
stochastic_depth_drop_rate
=
0.0
)),
dropout_rate
=
0.25
,
norm_activation
=
common
.
NormActivation
(
norm_momentum
=
0.0
,
norm_epsilon
=
1e-5
,
use_sync_bn
=
False
)),
norm_momentum
=
0.0
,
norm_epsilon
=
1e-5
,
use_sync_bn
=
False
,
activation
=
'swish'
)),
losses
=
Losses
(
l2_weight_decay
=
4e-5
,
label_smoothing
=
0.1
),
train_data
=
DataConfig
(
input_path
=
os
.
path
.
join
(
IMAGENET_INPUT_PATH_BASE
,
'train*'
),
is_training
=
True
,
global_batch_size
=
train_batch_size
,
aug_policy
=
'randaug'
),
aug_policy
=
'randaug'
,
randaug_magnitude
=
10
),
validation_data
=
DataConfig
(
input_path
=
os
.
path
.
join
(
IMAGENET_INPUT_PATH_BASE
,
'valid*'
),
is_training
=
False
,
...
...
@@ -199,7 +204,7 @@ def image_classification_imagenet_resnetrs() -> cfg.ExperimentConfig:
steps_per_loop
=
steps_per_epoch
,
summary_interval
=
steps_per_epoch
,
checkpoint_interval
=
steps_per_epoch
,
train_steps
=
3
6
0
*
steps_per_epoch
,
train_steps
=
3
5
0
*
steps_per_epoch
,
validation_steps
=
IMAGENET_VAL_EXAMPLES
//
eval_batch_size
,
validation_interval
=
steps_per_epoch
,
optimizer_config
=
optimization
.
OptimizationConfig
({
...
...
@@ -215,8 +220,8 @@ def image_classification_imagenet_resnetrs() -> cfg.ExperimentConfig:
'learning_rate'
:
{
'type'
:
'cosine'
,
'cosine'
:
{
'initial_learning_rate'
:
0.1
,
'decay_steps'
:
3
6
0
*
steps_per_epoch
'initial_learning_rate'
:
1.6
,
'decay_steps'
:
3
5
0
*
steps_per_epoch
}
},
'warmup'
:
{
...
...
official/vision/beta/dataloaders/classification_input.py
浏览文件 @
a86917df
...
...
@@ -49,6 +49,7 @@ class Parser(parser.Parser):
num_classes
:
float
,
aug_rand_hflip
:
bool
=
True
,
aug_policy
:
Optional
[
str
]
=
None
,
randaug_magnitude
:
Optional
[
int
]
=
10
,
dtype
:
str
=
'float32'
):
"""Initializes parameters for parsing annotations in the dataset.
...
...
@@ -59,6 +60,7 @@ class Parser(parser.Parser):
aug_rand_hflip: `bool`, if True, augment training with random
horizontal flip.
aug_policy: `str`, augmentation policies. None, 'autoaug', or 'randaug'.
randaug_magnitude: `int`, magnitude of the randaugment policy.
dtype: `str`, cast output image in dtype. It can be 'float32', 'float16',
or 'bfloat16'.
"""
...
...
@@ -77,7 +79,8 @@ class Parser(parser.Parser):
if
aug_policy
==
'autoaug'
:
self
.
_augmenter
=
augment
.
AutoAugment
()
elif
aug_policy
==
'randaug'
:
self
.
_augmenter
=
augment
.
RandAugment
(
num_layers
=
2
,
magnitude
=
20
)
self
.
_augmenter
=
augment
.
RandAugment
(
num_layers
=
2
,
magnitude
=
randaug_magnitude
)
else
:
raise
ValueError
(
'Augmentation policy {} not supported.'
.
format
(
aug_policy
))
...
...
official/vision/beta/tasks/image_classification.py
浏览文件 @
a86917df
...
...
@@ -93,6 +93,7 @@ class ImageClassificationTask(base_task.Task):
output_size
=
input_size
[:
2
],
num_classes
=
num_classes
,
aug_policy
=
params
.
aug_policy
,
randaug_magnitude
=
params
.
randaug_magnitude
,
dtype
=
params
.
dtype
)
reader
=
input_reader
.
InputReader
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录