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
a0876f62
Commit
a0876f62
authored
Jul 02, 2022
by
Gunho Park
Browse files
Internal change
parent
2412b118
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
18 deletions
+2
-18
official/projects/detr/configs/detr.py
official/projects/detr/configs/detr.py
+2
-4
official/projects/detr/do_train.sh
official/projects/detr/do_train.sh
+0
-7
official/projects/detr/tasks/detection.py
official/projects/detr/tasks/detection.py
+0
-7
No files found.
official/projects/detr/configs/detr.py
View file @
a0876f62
...
...
@@ -92,7 +92,6 @@ class DetrTask(cfg.TaskConfig):
COCO_INPUT_PATH_BASE
=
'gs://ghpark-tfrecords/coco'
COCO_TRAIN_EXAMPLES
=
118287
#COCO_TRAIN_EXAMPLES = 9600
COCO_VAL_EXAMPLES
=
5000
@
exp_factory
.
register_config_factory
(
'detr_coco'
)
...
...
@@ -100,10 +99,9 @@ def detr_coco() -> cfg.ExperimentConfig:
"""Config to get results that matches the paper."""
train_batch_size
=
32
eval_batch_size
=
64
num_train_data
=
118287
steps_per_epoch
=
COCO_TRAIN_EXAMPLES
//
train_batch_size
train_steps
=
300
*
steps_per_epoch
#
5
00 epochs
decay_at
=
train_steps
-
100
*
steps_per_epoch
#
4
00 epochs
train_steps
=
300
*
steps_per_epoch
#
3
00 epochs
decay_at
=
train_steps
-
100
*
steps_per_epoch
#
2
00 epochs
config
=
cfg
.
ExperimentConfig
(
task
=
DetrTask
(
init_checkpoint
=
'gs://ghpark-imagenet-tfrecord/ckpt/resnet50_imagenet'
,
...
...
official/projects/detr/do_train.sh
deleted
100644 → 0
View file @
2412b118
#!/bin/bash
python3 train.py
\
--experiment
=
detr_coco
\
--mode
=
train_and_eval
\
--model_dir
=
gs://ghpark-ckpts/detr/detr_coco/ckpt_03_detr_coco_resnet101
\
--tpu
=
postech-tpu
\
--params_override
=
runtime.distribution_strategy
=
'tpu'
\ No newline at end of file
official/projects/detr/tasks/detection.py
View file @
a0876f62
...
...
@@ -48,13 +48,6 @@ class DectectionTask(base_task.Task):
input_specs
=
tf
.
keras
.
layers
.
InputSpec
(
shape
=
[
None
]
+
self
.
_task_config
.
model
.
input_size
)
l2_weight_decay
=
self
.
task_config
.
losses
.
l2_weight_decay
# Divide weight decay by 2.0 to match the implementation of tf.nn.l2_loss.
# (https://www.tensorflow.org/api_docs/python/tf/keras/regularizers/l2)
# (https://www.tensorflow.org/api_docs/python/tf/nn/l2_loss)
l2_regularizer
=
(
tf
.
keras
.
regularizers
.
l2
(
l2_weight_decay
/
2.0
)
if
l2_weight_decay
else
None
)
backbone
=
backbones
.
factory
.
build_backbone
(
input_specs
=
input_specs
,
backbone_config
=
self
.
_task_config
.
model
.
backbone
,
...
...
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