From 117a4d187517f51ea914b17be8ac59ef1a36b594 Mon Sep 17 00:00:00 2001 From: justimyhxu Date: Sat, 18 Jul 2020 11:27:09 +0800 Subject: [PATCH] fix inference bug --- tools/test_recognizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test_recognizer.py b/tools/test_recognizer.py index f9f6805..a3f566b 100644 --- a/tools/test_recognizer.py +++ b/tools/test_recognizer.py @@ -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( @@ -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: