Skip to content

Commit 1229095

Browse files
committed
fix flake8 error in python 2
1 parent ba927c9 commit 1229095

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

mmdet/core/evaluation/eval_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def after_train_epoch(self, runner):
7474
# compute output
7575
with torch.no_grad():
7676
result = runner.model(
77-
**data_gpu, return_loss=False, rescale=True)
77+
return_loss=False, rescale=True, **data_gpu)
7878
results[idx] = result
7979

8080
batch_size = runner.world_size

mmdet/models/detectors/base.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ def extract_feat(self, imgs):
3434
pass
3535

3636
def extract_feats(self, imgs):
37-
if isinstance(imgs, torch.Tensor):
38-
return self.extract_feat(imgs)
39-
elif isinstance(imgs, list):
40-
for img in imgs:
41-
yield self.extract_feat(img)
37+
assert isinstance(imgs, list)
38+
for img in imgs:
39+
yield self.extract_feat(img)
4240

4341
@abstractmethod
4442
def forward_train(self, imgs, img_metas, **kwargs):

tools/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def single_test(model, data_loader, show=False):
1717
prog_bar = mmcv.ProgressBar(len(data_loader.dataset))
1818
for i, data in enumerate(data_loader):
1919
with torch.no_grad():
20-
result = model(**data, return_loss=False, rescale=not show)
20+
result = model(return_loss=False, rescale=not show, **data)
2121
results.append(result)
2222

2323
if show:

0 commit comments

Comments
 (0)