Det models with `nc=1` when `single_cls=True` (#19381)

Signed-off-by: Kevin Serrano <35779409+kevinconka@users.noreply.github.com>
pull/19400/head^2
Kevin Serrano 2 weeks ago committed by GitHub
parent afbc0524d0
commit acbe8e31d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      ultralytics/engine/trainer.py

@ -567,6 +567,10 @@ class BaseTrainer:
except Exception as e:
raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e
self.data = data
if self.args.single_cls:
LOGGER.info("Overriding class names with single class.")
self.data["names"] = {0: "item"}
self.data["nc"] = 1
return data["train"], data.get("val") or data.get("test")
def setup_model(self):

Loading…
Cancel
Save