Skip to content

Commit

Permalink
fix inference bug
Browse files Browse the repository at this point in the history
  • Loading branch information
justimyhxu authored Jul 18, 2020
1 parent 182dae0 commit 117a4d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/test_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def main():
if args.gpus == 1:
model = build_recognizer(
cfg.model, train_cfg=None, test_cfg=cfg.test_cfg)
load_checkpoint(model, args.checkpoint, strict=True, map_location='cpu')
load_checkpoint(model, args.checkpoint, strict=False, map_location='cpu')
model = MMDataParallel(model, device_ids=[0])

data_loader = build_dataloader(
Expand Down Expand Up @@ -206,7 +206,7 @@ def main():
shuffle=False)
model = build_recognizer(
cfg.model, train_cfg=None, test_cfg=cfg.test_cfg)
load_checkpoint(model, args.checkpoint, strict=True, map_location='cpu')
load_checkpoint(model, args.checkpoint, strict=False, map_location='cpu')
model = MMDistributedDataParallel(model.cuda())
outputs = multi_gpu_test(model, data_loader, args.tmpdir)
else:
Expand Down

0 comments on commit 117a4d1

Please sign in to comment.