Detection training zero-mAP fix (#192)

pull/193/head
Glenn Jocher 2 years ago committed by GitHub
parent a8a70390ab
commit 0a7d86cd26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ultralytics/yolo/engine/exporter.py
  2. 1
      ultralytics/yolo/engine/model.py
  3. 2
      ultralytics/yolo/v8/detect/train.py

@ -168,7 +168,7 @@ class Exporter:
# Input
im = torch.zeros(self.args.batch, 3, *self.imgsz).to(self.device)
file = Path(getattr(model, 'pt_path', None) or model.yaml['yaml_file'])
file = Path(getattr(model, 'pt_path', None) or getattr(model, 'yaml_file', None) or model.yaml['yaml_file'])
if file.suffix == '.yaml':
file = Path(file.name)

@ -218,3 +218,4 @@ class YOLO:
args.pop("batch", None)
args.pop("epochs", None)
args.pop("cache", None)
args.pop("save_json", None)

@ -60,7 +60,7 @@ class DetectionTrainer(BaseTrainer):
def get_model(self, cfg=None, weights=None, verbose=True):
model = DetectionModel(cfg, ch=3, nc=self.data["nc"], verbose=verbose)
if weights:
model.load(model)
model.load(weights)
return model

Loading…
Cancel
Save