Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
9070109e
"vscode:/vscode.git/clone" did not exist on "743fe1ab802c27c52a5372577d006d595e65677b"
Commit
9070109e
authored
Sep 28, 2020
by
Shixin Luo
Browse files
change the default number of gpu and tpu for the experiment config template
parent
bf4c3894
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
official/vision/beta/configs/experiments/image_classification/imagenet_mobilenetv2_1.0_gpu.yaml
...ts/image_classification/imagenet_mobilenetv2_1.0_gpu.yaml
+11
-11
official/vision/beta/configs/image_classification.py
official/vision/beta/configs/image_classification.py
+8
-5
No files found.
official/vision/beta/configs/experiments/image_classification/imagenet_mobilenetv2_1.0_gpu.yaml
View file @
9070109e
...
@@ -19,21 +19,21 @@ task:
...
@@ -19,21 +19,21 @@ task:
train_data
:
train_data
:
input_path
:
'
imagenet-2012-tfrecord/train*'
input_path
:
'
imagenet-2012-tfrecord/train*'
is_training
:
True
is_training
:
True
global_batch_size
:
96
global_batch_size
:
768
# 96 * 8
dtype
:
'
float32'
dtype
:
'
float32'
validation_data
:
validation_data
:
input_path
:
'
imagenet-2012-tfrecord/valid*'
input_path
:
'
imagenet-2012-tfrecord/valid*'
is_training
:
False
is_training
:
False
global_batch_size
:
96
global_batch_size
:
768
# 96 * 8
dtype
:
'
float32'
dtype
:
'
float32'
drop_remainder
:
False
drop_remainder
:
False
trainer
:
trainer
:
train_steps
:
1
2
01
050
# 90 * steps_per_epoch
train_steps
:
1
5
01
20
# 90 * steps_per_epoch
validation_steps
:
5
20
validation_steps
:
6
5
validation_interval
:
1
3345
validation_interval
:
1
668
steps_per_loop
:
1
3345
# NUM_EXAMPLES (1281167) // global_batch_size
steps_per_loop
:
1
668
# NUM_EXAMPLES (1281167) // global_batch_size
summary_interval
:
1
3345
summary_interval
:
1
668
checkpoint_interval
:
1
3345
checkpoint_interval
:
1
668
optimizer_config
:
optimizer_config
:
optimizer
:
optimizer
:
type
:
'
rmsprop'
type
:
'
rmsprop'
...
@@ -44,13 +44,13 @@ trainer:
...
@@ -44,13 +44,13 @@ trainer:
learning_rate
:
learning_rate
:
type
:
'
exponential'
type
:
'
exponential'
exponential
:
exponential
:
initial_learning_rate
:
0.
045,
initial_learning_rate
:
0.
36,
# 0.045 * NUM_GPUS
decay_steps
:
33362,
# 2.5 * steps_per_epoch
decay_steps
:
4170,
# 2.5 * steps_per_epoch
decay_rate
:
0.97,
decay_rate
:
0.97,
staircase
:
True
staircase
:
True
warmup
:
warmup
:
type
:
'
linear'
type
:
'
linear'
linear
:
linear
:
warmup_steps
:
66725
# 5 * steps_per_epoch
warmup_steps
:
8340
# 5 * steps_per_epoch
ema
:
ema
:
average_decay
:
0.9999
average_decay
:
0.9999
\ No newline at end of file
official/vision/beta/configs/image_classification.py
View file @
9070109e
...
@@ -218,8 +218,8 @@ def image_classification_imagenet_revnet() -> cfg.ExperimentConfig:
...
@@ -218,8 +218,8 @@ def image_classification_imagenet_revnet() -> cfg.ExperimentConfig:
@
exp_factory
.
register_config_factory
(
'mobilenet_imagenet'
)
@
exp_factory
.
register_config_factory
(
'mobilenet_imagenet'
)
def
image_classification_imagenet_mobilenet
()
->
cfg
.
ExperimentConfig
:
def
image_classification_imagenet_mobilenet
()
->
cfg
.
ExperimentConfig
:
"""Image classification on imagenet with mobilenet."""
"""Image classification on imagenet with mobilenet."""
train_batch_size
=
1
92
train_batch_size
=
1
536
# 96 * 16
eval_batch_size
=
1
92
eval_batch_size
=
1
536
# 96 * 16
steps_per_epoch
=
IMAGENET_TRAIN_EXAMPLES
//
train_batch_size
steps_per_epoch
=
IMAGENET_TRAIN_EXAMPLES
//
train_batch_size
config
=
cfg
.
ExperimentConfig
(
config
=
cfg
.
ExperimentConfig
(
task
=
ImageClassificationTask
(
task
=
ImageClassificationTask
(
...
@@ -261,9 +261,12 @@ def image_classification_imagenet_mobilenet() -> cfg.ExperimentConfig:
...
@@ -261,9 +261,12 @@ def image_classification_imagenet_mobilenet() -> cfg.ExperimentConfig:
'learning_rate'
:
{
'learning_rate'
:
{
'type'
:
'exponential'
,
'type'
:
'exponential'
,
'exponential'
:
{
'exponential'
:
{
'initial_learning_rate'
:
0.045
,
# 0.045 * NUM_GPUS
'decay_steps'
:
int
(
2.4
*
steps_per_epoch
),
'initial_learning_rate'
:
0.045
*
(
train_batch_size
//
96
),
'decay_rate'
:
0.97
,
# (2.5 / NUM_GPUS) epochs
'decay_steps'
:
int
((
2.5
/
(
train_batch_size
//
96
))
*
steps_per_epoch
),
'decay_rate'
:
0.98
,
'staircase'
:
True
'staircase'
:
True
}
}
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment