DDP, Comet, URLError fixes, improved error handling (#658)

Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tungway1990 <68179274+Tungway1990@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-01-28 01:31:41 +01:00
committed by GitHub
parent 6c44ce21d9
commit a5410ed79e
22 changed files with 79 additions and 81 deletions

View File

@ -69,7 +69,7 @@ def predict(cfg=DEFAULT_CFG, use_python=False):
source = cfg.source if cfg.source is not None else ROOT / "assets" if (ROOT / "assets").exists() \
else "https://ultralytics.com/images/bus.jpg"
args = dict(model=model, source=source, verbose=True)
args = dict(model=model, source=source)
if use_python:
from ultralytics import YOLO
YOLO(model)(**args)

View File

@ -141,7 +141,7 @@ def train(cfg=DEFAULT_CFG, use_python=False):
data = cfg.data or "mnist160" # or yolo.ClassificationDataset("mnist")
device = cfg.device if cfg.device is not None else ''
args = dict(model=model, data=data, device=device, verbose=True)
args = dict(model=model, data=data, device=device)
if use_python:
from ultralytics import YOLO
YOLO(model).train(**args)

View File

@ -50,7 +50,7 @@ def val(cfg=DEFAULT_CFG, use_python=False):
model = cfg.model or "yolov8n-cls.pt" # or "resnet18"
data = cfg.data or "mnist160"
args = dict(model=model, data=data, verbose=True)
args = dict(model=model, data=data)
if use_python:
from ultralytics import YOLO
YOLO(model).val(**args)

View File

@ -87,7 +87,7 @@ def predict(cfg=DEFAULT_CFG, use_python=False):
source = cfg.source if cfg.source is not None else ROOT / "assets" if (ROOT / "assets").exists() \
else "https://ultralytics.com/images/bus.jpg"
args = dict(model=model, source=source, verbose=True)
args = dict(model=model, source=source)
if use_python:
from ultralytics import YOLO
YOLO(model)(**args)

View File

@ -199,7 +199,7 @@ def train(cfg=DEFAULT_CFG, use_python=False):
data = cfg.data or "coco128.yaml" # or yolo.ClassificationDataset("mnist")
device = cfg.device if cfg.device is not None else ''
args = dict(model=model, data=data, device=device, verbose=True)
args = dict(model=model, data=data, device=device)
if use_python:
from ultralytics import YOLO
YOLO(model).train(**args)

View File

@ -129,7 +129,7 @@ class DetectionValidator(BaseValidator):
f'WARNING ⚠️ no labels found in {self.args.task} set, can not compute metrics without labels')
# Print results per class
if (self.args.verbose or not self.training) and self.nc > 1 and len(self.stats):
if self.args.verbose and not self.training and self.nc > 1 and len(self.stats):
for i, c in enumerate(self.metrics.ap_class_index):
self.logger.info(pf % (self.names[c], self.seen, self.nt_per_class[c], *self.metrics.class_result(i)))
@ -237,7 +237,7 @@ def val(cfg=DEFAULT_CFG, use_python=False):
model = cfg.model or "yolov8n.pt"
data = cfg.data or "coco128.yaml"
args = dict(model=model, data=data, verbose=True)
args = dict(model=model, data=data)
if use_python:
from ultralytics import YOLO
YOLO(model).val(**args)

View File

@ -105,7 +105,7 @@ def predict(cfg=DEFAULT_CFG, use_python=False):
source = cfg.source if cfg.source is not None else ROOT / "assets" if (ROOT / "assets").exists() \
else "https://ultralytics.com/images/bus.jpg"
args = dict(model=model, source=source, verbose=True)
args = dict(model=model, source=source)
if use_python:
from ultralytics import YOLO
YOLO(model)(**args)

View File

@ -145,7 +145,7 @@ def train(cfg=DEFAULT_CFG, use_python=False):
data = cfg.data or "coco128-seg.yaml" # or yolo.ClassificationDataset("mnist")
device = cfg.device if cfg.device is not None else ''
args = dict(model=model, data=data, device=device, verbose=True)
args = dict(model=model, data=data, device=device)
if use_python:
from ultralytics import YOLO
YOLO(model).train(**args)

View File

@ -247,7 +247,7 @@ def val(cfg=DEFAULT_CFG, use_python=False):
model = cfg.model or "yolov8n-seg.pt"
data = cfg.data or "coco128-seg.yaml"
args = dict(model=model, data=data, verbose=True)
args = dict(model=model, data=data)
if use_python:
from ultralytics import YOLO
YOLO(model).val(**args)