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
8f70f9df
Unverified
Commit
8f70f9df
authored
Jun 03, 2019
by
Kai Chen
Committed by
GitHub
Jun 03, 2019
Browse files
bug fix for testing visualization (#747)
parent
58c415a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
tools/test.py
tools/test.py
+11
-3
No files found.
tools/test.py
View file @
8f70f9df
...
...
@@ -63,8 +63,10 @@ def collect_results(result_part, size, tmpdir=None):
if
tmpdir
is
None
:
MAX_LEN
=
512
# 32 is whitespace
dir_tensor
=
torch
.
full
(
(
MAX_LEN
,
),
32
,
dtype
=
torch
.
uint8
,
device
=
'cuda'
)
dir_tensor
=
torch
.
full
((
MAX_LEN
,
),
32
,
dtype
=
torch
.
uint8
,
device
=
'cuda'
)
if
rank
==
0
:
tmpdir
=
tempfile
.
mkdtemp
()
tmpdir
=
torch
.
tensor
(
...
...
@@ -152,7 +154,13 @@ def main():
# build the model and load checkpoint
model
=
build_detector
(
cfg
.
model
,
train_cfg
=
None
,
test_cfg
=
cfg
.
test_cfg
)
load_checkpoint
(
model
,
args
.
checkpoint
,
map_location
=
'cpu'
)
checkpoint
=
load_checkpoint
(
model
,
args
.
checkpoint
,
map_location
=
'cpu'
)
# old versions did not save class info in checkpoints, this walkaround is
# for backward compatibility
if
'CLASSES'
in
checkpoint
[
'meta'
]:
model
.
CLASSES
=
checkpoint
[
'meta'
][
'CLASSES'
]
else
:
model
.
CLASSES
=
dataset
.
CLASSES
if
not
distributed
:
model
=
MMDataParallel
(
model
,
device_ids
=
[
0
])
...
...
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