Commit 0fda5f9a authored by Camille Barneaud's avatar Camille Barneaud Committed by Facebook Github Bot

Do not download TRAIN.WEIGHTS in infer_simple.py & infer.py

Summary:
Before this change <code>assert_and_infer_cfg</code> would override the weights passed by the user with CFG ones.

It is normal to change it as the user is required to pass weights, otherwise there will be this error :
<code>AssertionError: <class 'NoneType'></code>. (verified only in infer_simple.py)

Sort of follow-up of eddb1301.
Closes https://github.com/facebookresearch/Detectron/pull/331

Reviewed By: ir413

Differential Revision: D7569224

Pulled By: rbgirshick

fbshipit-source-id: 00dbaadd2440f39b2b3440b4101a58ed3e68a908
parent 48405526
......@@ -105,7 +105,7 @@ def get_rpn_box_proposals(im, args):
cfg.MODEL.RPN_ONLY = True
cfg.TEST.RPN_PRE_NMS_TOP_N = 10000
cfg.TEST.RPN_POST_NMS_TOP_N = 2000
assert_and_infer_cfg()
assert_and_infer_cfg(cache_urls=False)
model = model_engine.initialize_model_from_cfg(args.rpn_pkl)
with c2_utils.NamedCudaScope(0):
......@@ -137,7 +137,7 @@ def main(args):
else:
weights_file = cfg.TEST.WEIGHTS
cfg.NUM_GPUS = 1
assert_and_infer_cfg()
assert_and_infer_cfg(cache_urls=False)
model = model_engine.initialize_model_from_cfg(weights_file)
with c2_utils.NamedCudaScope(0):
cls_boxes_, cls_segms_, cls_keyps_ = \
......
......@@ -96,7 +96,7 @@ def main(args):
merge_cfg_from_file(args.cfg)
cfg.NUM_GPUS = 1
args.weights = cache_url(args.weights, cfg.DOWNLOAD_CACHE)
assert_and_infer_cfg()
assert_and_infer_cfg(cache_urls=False)
model = infer_engine.initialize_model_from_cfg(args.weights)
dummy_coco_dataset = dummy_datasets.get_coco_dataset()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment