weight_decay fix

This commit is contained in:
Glenn Jocher 2019-08-28 16:15:10 +02:00
parent c906047db3
commit 23dfeacfcd
1 changed files with 17 additions and 14 deletions

View File

@ -165,6 +165,7 @@ def test(cfg,
# Save JSON # Save JSON
if save_json and map and len(jdict): if save_json and map and len(jdict):
try:
imgIds = [int(Path(x).stem.split('_')[-1]) for x in dataset.img_files] imgIds = [int(Path(x).stem.split('_')[-1]) for x in dataset.img_files]
with open('results.json', 'w') as file: with open('results.json', 'w') as file:
json.dump(jdict, file) json.dump(jdict, file)
@ -182,6 +183,8 @@ def test(cfg,
cocoEval.accumulate() cocoEval.accumulate()
cocoEval.summarize() cocoEval.summarize()
map = cocoEval.stats[1] # update mAP to pycocotools mAP map = cocoEval.stats[1] # update mAP to pycocotools mAP
except:
print('WARNING: pycocotools not installed, can not compute official COCO mAP')
# Return results # Return results
maps = np.zeros(nc) + map maps = np.zeros(nc) + map