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
OpenDAS
vision
Commits
537f0df7
Commit
537f0df7
authored
Nov 25, 2019
by
Yoshitomo Matsubara
Committed by
Francisco Massa
Nov 25, 2019
Browse files
update default parameters (#1611)
parent
d88d8961
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
references/detection/train.py
references/detection/train.py
+11
-3
No files found.
references/detection/train.py
View file @
537f0df7
...
@@ -8,6 +8,14 @@ To run in a multi-gpu environment, use the distributed launcher::
...
@@ -8,6 +8,14 @@ To run in a multi-gpu environment, use the distributed launcher::
The default hyperparameters are tuned for training on 8 gpus and 2 images per gpu.
The default hyperparameters are tuned for training on 8 gpus and 2 images per gpu.
--lr 0.02 --batch-size 2 --world-size 8
--lr 0.02 --batch-size 2 --world-size 8
If you use different number of gpus, the learning rate should be changed to 0.02/8*$NGPU.
If you use different number of gpus, the learning rate should be changed to 0.02/8*$NGPU.
On top of that, for training Faster/Mask R-CNN, the default hyperparameters are
--epochs 26 --lr-steps 16 22 --aspect-ratio-group-factor 3
Also, if you train Keypoint R-CNN, the default hyperparameters are
--epochs 46 --lr-steps 36 43 --aspect-ratio-group-factor 3
Because the number of images is smaller in the person keypoint subset of COCO,
the number of epochs should be adapted so that we have the same number of iterations.
"""
"""
import
datetime
import
datetime
import
os
import
os
...
@@ -145,7 +153,7 @@ if __name__ == "__main__":
...
@@ -145,7 +153,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
'--device'
,
default
=
'cuda'
,
help
=
'device'
)
parser
.
add_argument
(
'--device'
,
default
=
'cuda'
,
help
=
'device'
)
parser
.
add_argument
(
'-b'
,
'--batch-size'
,
default
=
2
,
type
=
int
,
parser
.
add_argument
(
'-b'
,
'--batch-size'
,
default
=
2
,
type
=
int
,
help
=
'images per gpu, the total batch size is $NGPU x batch_size'
)
help
=
'images per gpu, the total batch size is $NGPU x batch_size'
)
parser
.
add_argument
(
'--epochs'
,
default
=
13
,
type
=
int
,
metavar
=
'N'
,
parser
.
add_argument
(
'--epochs'
,
default
=
26
,
type
=
int
,
metavar
=
'N'
,
help
=
'number of total epochs to run'
)
help
=
'number of total epochs to run'
)
parser
.
add_argument
(
'-j'
,
'--workers'
,
default
=
4
,
type
=
int
,
metavar
=
'N'
,
parser
.
add_argument
(
'-j'
,
'--workers'
,
default
=
4
,
type
=
int
,
metavar
=
'N'
,
help
=
'number of data loading workers (default: 4)'
)
help
=
'number of data loading workers (default: 4)'
)
...
@@ -158,12 +166,12 @@ if __name__ == "__main__":
...
@@ -158,12 +166,12 @@ if __name__ == "__main__":
metavar
=
'W'
,
help
=
'weight decay (default: 1e-4)'
,
metavar
=
'W'
,
help
=
'weight decay (default: 1e-4)'
,
dest
=
'weight_decay'
)
dest
=
'weight_decay'
)
parser
.
add_argument
(
'--lr-step-size'
,
default
=
8
,
type
=
int
,
help
=
'decrease lr every step-size epochs'
)
parser
.
add_argument
(
'--lr-step-size'
,
default
=
8
,
type
=
int
,
help
=
'decrease lr every step-size epochs'
)
parser
.
add_argument
(
'--lr-steps'
,
default
=
[
8
,
11
],
nargs
=
'+'
,
type
=
int
,
help
=
'decrease lr every step-size epochs'
)
parser
.
add_argument
(
'--lr-steps'
,
default
=
[
16
,
22
],
nargs
=
'+'
,
type
=
int
,
help
=
'decrease lr every step-size epochs'
)
parser
.
add_argument
(
'--lr-gamma'
,
default
=
0.1
,
type
=
float
,
help
=
'decrease lr by a factor of lr-gamma'
)
parser
.
add_argument
(
'--lr-gamma'
,
default
=
0.1
,
type
=
float
,
help
=
'decrease lr by a factor of lr-gamma'
)
parser
.
add_argument
(
'--print-freq'
,
default
=
20
,
type
=
int
,
help
=
'print frequency'
)
parser
.
add_argument
(
'--print-freq'
,
default
=
20
,
type
=
int
,
help
=
'print frequency'
)
parser
.
add_argument
(
'--output-dir'
,
default
=
'.'
,
help
=
'path where to save'
)
parser
.
add_argument
(
'--output-dir'
,
default
=
'.'
,
help
=
'path where to save'
)
parser
.
add_argument
(
'--resume'
,
default
=
''
,
help
=
'resume from checkpoint'
)
parser
.
add_argument
(
'--resume'
,
default
=
''
,
help
=
'resume from checkpoint'
)
parser
.
add_argument
(
'--aspect-ratio-group-factor'
,
default
=
0
,
type
=
int
)
parser
.
add_argument
(
'--aspect-ratio-group-factor'
,
default
=
3
,
type
=
int
)
parser
.
add_argument
(
parser
.
add_argument
(
"--test-only"
,
"--test-only"
,
dest
=
"test_only"
,
dest
=
"test_only"
,
...
...
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