mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 05:24:22 +08:00
Detection training zero-mAP fix (#192)
This commit is contained in:
parent
a8a70390ab
commit
0a7d86cd26
@ -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…
x
Reference in New Issue
Block a user