mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-24 22:54:21 +08:00
ultralytics 8.1.13
fix yolo train time=
bug (#8179)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
920ce66bf8
commit
863c788f67
@ -1,10 +1,10 @@
|
|||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
|
import PIL
|
||||||
|
|
||||||
from ultralytics import Explorer
|
from ultralytics import Explorer
|
||||||
from ultralytics.utils import ASSETS
|
from ultralytics.utils import ASSETS
|
||||||
|
|
||||||
import PIL
|
|
||||||
|
|
||||||
|
|
||||||
def test_similarity():
|
def test_similarity():
|
||||||
"""Test similarity calculations and SQL queries for correctness and response length."""
|
"""Test similarity calculations and SQL queries for correctness and response length."""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
__version__ = "8.1.12"
|
__version__ = "8.1.13"
|
||||||
|
|
||||||
from ultralytics.data.explorer.explorer import Explorer
|
from ultralytics.data.explorer.explorer import Explorer
|
||||||
from ultralytics.models import RTDETR, SAM, YOLO
|
from ultralytics.models import RTDETR, SAM, YOLO
|
||||||
|
@ -337,8 +337,8 @@ class BaseTrainer:
|
|||||||
if self.args.close_mosaic:
|
if self.args.close_mosaic:
|
||||||
base_idx = (self.epochs - self.args.close_mosaic) * nb
|
base_idx = (self.epochs - self.args.close_mosaic) * nb
|
||||||
self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2])
|
self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2])
|
||||||
epoch = self.epochs # predefine for resume fully trained model edge cases
|
epoch = self.start_epoch
|
||||||
for epoch in range(self.start_epoch, self.epochs):
|
while True:
|
||||||
self.epoch = epoch
|
self.epoch = epoch
|
||||||
self.run_callbacks("on_train_epoch_start")
|
self.run_callbacks("on_train_epoch_start")
|
||||||
self.model.train()
|
self.model.train()
|
||||||
@ -423,7 +423,7 @@ class BaseTrainer:
|
|||||||
if self.args.val or final_epoch or self.stopper.possible_stop or self.stop:
|
if self.args.val or final_epoch or self.stopper.possible_stop or self.stop:
|
||||||
self.metrics, self.fitness = self.validate()
|
self.metrics, self.fitness = self.validate()
|
||||||
self.save_metrics(metrics={**self.label_loss_items(self.tloss), **self.metrics, **self.lr})
|
self.save_metrics(metrics={**self.label_loss_items(self.tloss), **self.metrics, **self.lr})
|
||||||
self.stop |= self.stopper(epoch + 1, self.fitness)
|
self.stop |= self.stopper(epoch + 1, self.fitness) or final_epoch
|
||||||
if self.args.time:
|
if self.args.time:
|
||||||
self.stop |= (time.time() - self.train_time_start) > (self.args.time * 3600)
|
self.stop |= (time.time() - self.train_time_start) > (self.args.time * 3600)
|
||||||
|
|
||||||
@ -455,6 +455,7 @@ class BaseTrainer:
|
|||||||
self.stop = broadcast_list[0]
|
self.stop = broadcast_list[0]
|
||||||
if self.stop:
|
if self.stop:
|
||||||
break # must break all DDP ranks
|
break # must break all DDP ranks
|
||||||
|
epoch += 1
|
||||||
|
|
||||||
if RANK in (-1, 0):
|
if RANK in (-1, 0):
|
||||||
# Do final val with best.pt
|
# Do final val with best.pt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user