Skip to content
Snippets Groups Projects
Commit 1229095f authored by Kai Chen's avatar Kai Chen
Browse files

fix flake8 error in python 2

parent ba927c9e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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):
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment