Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
food-round2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joel Joseph
food-round2
Commits
8f70f9df
Unverified
Commit
8f70f9df
authored
5 years ago
by
Kai Chen
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bug fix for testing visualization (#747)
parent
58c415a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/test.py
+11
-3
11 additions, 3 deletions
tools/test.py
with
11 additions
and
3 deletions
tools/test.py
+
11
−
3
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
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment