weight_decay fix
This commit is contained in:
parent
c906047db3
commit
23dfeacfcd
3
test.py
3
test.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue