Fix overrides training cfg bug (#10002)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Ultralytics AI Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
parent
a506a55062
commit
3bbbdcfef8
1 changed files with 6 additions and 1 deletions
|
|
@ -641,7 +641,12 @@ class Model(nn.Module):
|
|||
checks.check_pip_update_available()
|
||||
|
||||
overrides = yaml_load(checks.check_yaml(kwargs["cfg"])) if kwargs.get("cfg") else self.overrides
|
||||
custom = {"data": DEFAULT_CFG_DICT["data"] or TASK2DATA[self.task]} # method defaults
|
||||
custom = {
|
||||
# NOTE: handle the case when 'cfg' includes 'data'.
|
||||
"data": overrides.get("data") or DEFAULT_CFG_DICT["data"] or TASK2DATA[self.task],
|
||||
"model": self.overrides["model"],
|
||||
"task": self.task,
|
||||
} # method defaults
|
||||
args = {**overrides, **custom, **kwargs, "mode": "train"} # highest priority args on the right
|
||||
if args.get("resume"):
|
||||
args["resume"] = self.ckpt_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue