W&B dict copy to fix change bug (#12779)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/12774/head^2
Ben Pikus 6 months ago committed by GitHub
parent 06ff89b404
commit e26036d965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/utils/callbacks/wb.py

@ -100,7 +100,7 @@ def _plot_curve(
def _log_plots(plots, step):
"""Logs plots from the input dictionary if they haven't been logged already at the specified step."""
for name, params in plots.items():
for name, params in plots.copy().items(): # shallow copy to prevent plots dict changing during iteration
timestamp = params["timestamp"]
if _processed_plots.get(name) != timestamp:
wb.run.log({name.stem: wb.Image(str(name))}, step=step)

Loading…
Cancel
Save