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
SOLOv2-pytorch
Commits
7c2b8148
Commit
7c2b8148
authored
Oct 10, 2018
by
Kai Chen
Browse files
add an argument to specify process per gpu
parent
20762ce9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
tools/test.py
tools/test.py
+15
-3
No files found.
tools/test.py
View file @
7c2b8148
...
@@ -39,7 +39,13 @@ def parse_args():
...
@@ -39,7 +39,13 @@ def parse_args():
parser
=
argparse
.
ArgumentParser
(
description
=
'MMDet test detector'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'MMDet test detector'
)
parser
.
add_argument
(
'config'
,
help
=
'test config file path'
)
parser
.
add_argument
(
'config'
,
help
=
'test config file path'
)
parser
.
add_argument
(
'checkpoint'
,
help
=
'checkpoint file'
)
parser
.
add_argument
(
'checkpoint'
,
help
=
'checkpoint file'
)
parser
.
add_argument
(
'--gpus'
,
default
=
1
,
type
=
int
)
parser
.
add_argument
(
'--gpus'
,
default
=
1
,
type
=
int
,
help
=
'GPU number used for testing'
)
parser
.
add_argument
(
'--proc_per_gpu'
,
default
=
1
,
type
=
int
,
help
=
'Number of processes per GPU'
)
parser
.
add_argument
(
'--out'
,
help
=
'output result file'
)
parser
.
add_argument
(
'--out'
,
help
=
'output result file'
)
parser
.
add_argument
(
parser
.
add_argument
(
'--eval'
,
'--eval'
,
...
@@ -81,8 +87,14 @@ def main():
...
@@ -81,8 +87,14 @@ def main():
model_args
=
cfg
.
model
.
copy
()
model_args
=
cfg
.
model
.
copy
()
model_args
.
update
(
train_cfg
=
None
,
test_cfg
=
cfg
.
test_cfg
)
model_args
.
update
(
train_cfg
=
None
,
test_cfg
=
cfg
.
test_cfg
)
model_type
=
getattr
(
detectors
,
model_args
.
pop
(
'type'
))
model_type
=
getattr
(
detectors
,
model_args
.
pop
(
'type'
))
outputs
=
parallel_test
(
model_type
,
model_args
,
args
.
checkpoint
,
outputs
=
parallel_test
(
dataset
,
_data_func
,
range
(
args
.
gpus
))
model_type
,
model_args
,
args
.
checkpoint
,
dataset
,
_data_func
,
range
(
args
.
gpus
),
workers_per_gpu
=
args
.
proc_per_gpu
)
if
args
.
out
:
if
args
.
out
:
print
(
'writing results to {}'
.
format
(
args
.
out
))
print
(
'writing results to {}'
.
format
(
args
.
out
))
...
...
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