ultralytics 8.0.44 export and task fixes (#1088)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mehran Ghandehari <mehran.maps@gmail.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
This commit is contained in:
parent
fe61018975
commit
3ea659411b
32 changed files with 439 additions and 480 deletions
|
|
@ -2,17 +2,24 @@
|
|||
|
||||
from torch.utils.tensorboard import SummaryWriter
|
||||
|
||||
from ultralytics.yolo.utils import LOGGER
|
||||
|
||||
writer = None # TensorBoard SummaryWriter instance
|
||||
|
||||
|
||||
def _log_scalars(scalars, step=0):
|
||||
for k, v in scalars.items():
|
||||
writer.add_scalar(k, v, step)
|
||||
if writer:
|
||||
for k, v in scalars.items():
|
||||
writer.add_scalar(k, v, step)
|
||||
|
||||
|
||||
def on_pretrain_routine_start(trainer):
|
||||
global writer
|
||||
writer = SummaryWriter(str(trainer.save_dir))
|
||||
try:
|
||||
writer = SummaryWriter(str(trainer.save_dir))
|
||||
except Exception as e:
|
||||
writer = None # TensorBoard SummaryWriter instance
|
||||
LOGGER.warning(f'WARNING ⚠️ TensorBoard not initialized correctly, not logging this run. {e}')
|
||||
|
||||
|
||||
def on_batch_end(trainer):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue