From 6bbaf854c7a4e62373ef97aa949688f75979493f Mon Sep 17 00:00:00 2001 From: Johnqczhang Date: Fri, 14 Jun 2019 16:30:06 +0800 Subject: [PATCH] allow test for checkpoint from cfg.MODEL.WEIGHT (#894) --- tools/test_net.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test_net.py b/tools/test_net.py index 7a2d3f7b9..ee3bf4cab 100644 --- a/tools/test_net.py +++ b/tools/test_net.py @@ -78,7 +78,8 @@ def main(): output_dir = cfg.OUTPUT_DIR checkpointer = DetectronCheckpointer(cfg, model, save_dir=output_dir) - _ = checkpointer.load(args.ckpt, use_latest=args.ckpt is None) + ckpt = cfg.MODEL.WEIGHT if args.ckpt is None else args.ckpt + _ = checkpointer.load(ckpt, use_latest=args.ckpt is None) iou_types = ("bbox",) if cfg.MODEL.MASK_ON: