Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Jun 9, 2024
2 parents fbb83e8 + 3742ab4 commit cce0830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,12 @@ def yaml_load(file="data.yaml"):
return yaml.safe_load(f)


def yaml_save(file="data.yaml", data={}):
def yaml_save(file="data.yaml", data=None):
"""Safely saves `data` to a YAML file specified by `file`, converting `Path` objects to strings; `data` is a
dictionary.
"""
if data is None:
data = {}
with open(file, "w") as f:
yaml.safe_dump({k: str(v) if isinstance(v, Path) else v for k, v in data.items()}, f, sort_keys=False)

Expand Down
9 changes: 5 additions & 4 deletions utils/loggers/clearml/clearml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def construct_dataset(clearml_info_string):
{"train", "test", "val", "nc", "names"}
), "The right keys were not found in the yaml file, make sure it at least has the following keys: ('train', 'test', 'val', 'nc', 'names')"

data_dict = {}
data_dict["train"] = (
str((dataset_root_path / dataset_definition["train"]).resolve()) if dataset_definition["train"] else None
)
data_dict = {
"train": (
str((dataset_root_path / dataset_definition["train"]).resolve()) if dataset_definition["train"] else None
)
}
data_dict["test"] = (
str((dataset_root_path / dataset_definition["test"]).resolve()) if dataset_definition["test"] else None
)
Expand Down

0 comments on commit cce0830

Please sign in to comment.