Unverified 提交 be348cc3 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Validate --task speed CPU fix (#10244)

上级 72cad398
...@@ -444,7 +444,7 @@ def main(opt): ...@@ -444,7 +444,7 @@ def main(opt):
else: else:
weights = opt.weights if isinstance(opt.weights, list) else [opt.weights] weights = opt.weights if isinstance(opt.weights, list) else [opt.weights]
opt.half = True # FP16 for fastest results opt.half = torch.cuda.is_available() and opt.device != 'cpu' # FP16 for fastest results
if opt.task == 'speed': # speed benchmarks if opt.task == 'speed': # speed benchmarks
# python val.py --task speed --data coco.yaml --batch 1 --weights yolov5n.pt yolov5s.pt... # python val.py --task speed --data coco.yaml --batch 1 --weights yolov5n.pt yolov5s.pt...
opt.conf_thres, opt.iou_thres, opt.save_json = 0.25, 0.45, False opt.conf_thres, opt.iou_thres, opt.save_json = 0.25, 0.45, False
......
...@@ -380,7 +380,7 @@ def main(opt): ...@@ -380,7 +380,7 @@ def main(opt):
else: else:
weights = opt.weights if isinstance(opt.weights, list) else [opt.weights] weights = opt.weights if isinstance(opt.weights, list) else [opt.weights]
opt.half = True # FP16 for fastest results opt.half = torch.cuda.is_available() and opt.device != 'cpu' # FP16 for fastest results
if opt.task == 'speed': # speed benchmarks if opt.task == 'speed': # speed benchmarks
# python val.py --task speed --data coco.yaml --batch 1 --weights yolov5n.pt yolov5s.pt... # python val.py --task speed --data coco.yaml --batch 1 --weights yolov5n.pt yolov5s.pt...
opt.conf_thres, opt.iou_thres, opt.save_json = 0.25, 0.45, False opt.conf_thres, opt.iou_thres, opt.save_json = 0.25, 0.45, False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论