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
1229095f
Commit
1229095f
authored
Oct 10, 2018
by
Kai Chen
Browse files
fix flake8 error in python 2
parent
ba927c9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
mmdet/core/evaluation/eval_hooks.py
mmdet/core/evaluation/eval_hooks.py
+1
-1
mmdet/models/detectors/base.py
mmdet/models/detectors/base.py
+3
-5
tools/test.py
tools/test.py
+1
-1
No files found.
mmdet/core/evaluation/eval_hooks.py
View file @
1229095f
...
...
@@ -74,7 +74,7 @@ class DistEvalHook(Hook):
# compute output
with
torch
.
no_grad
():
result
=
runner
.
model
(
**
data_gpu
,
return_loss
=
False
,
rescale
=
True
)
return_loss
=
False
,
rescale
=
True
,
**
data_gpu
)
results
[
idx
]
=
result
batch_size
=
runner
.
world_size
...
...
mmdet/models/detectors/base.py
View file @
1229095f
...
...
@@ -34,11 +34,9 @@ class BaseDetector(nn.Module):
pass
def
extract_feats
(
self
,
imgs
):
if
isinstance
(
imgs
,
torch
.
Tensor
):
return
self
.
extract_feat
(
imgs
)
elif
isinstance
(
imgs
,
list
):
for
img
in
imgs
:
yield
self
.
extract_feat
(
img
)
assert
isinstance
(
imgs
,
list
)
for
img
in
imgs
:
yield
self
.
extract_feat
(
img
)
@
abstractmethod
def
forward_train
(
self
,
imgs
,
img_metas
,
**
kwargs
):
...
...
tools/test.py
View file @
1229095f
...
...
@@ -17,7 +17,7 @@ def single_test(model, data_loader, show=False):
prog_bar
=
mmcv
.
ProgressBar
(
len
(
data_loader
.
dataset
))
for
i
,
data
in
enumerate
(
data_loader
):
with
torch
.
no_grad
():
result
=
model
(
**
data
,
return_loss
=
False
,
rescale
=
not
show
)
result
=
model
(
return_loss
=
False
,
rescale
=
not
show
,
**
data
)
results
.
append
(
result
)
if
show
:
...
...
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