Unverified 提交 c98128fe authored 作者: KristenKehrer's avatar KristenKehrer 提交者: GitHub

Allow list for Comet artifact class 'names' field (#9654)

* Update __init__.py In the Comet logger, when I run train.py, it wants to download the data artifact. It was requiring me to format the 'names' field in the data artifact metadata as a dictionary, so I've changed this so that it also accepts a list. Signed-off-by: 's avatarKristenKehrer <34010022+KristenKehrer@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update utils/loggers/comet/__init__.py Co-authored-by: 's avatarDhruv Nair <dhruv.nair@gmail.com> Signed-off-by: 's avatarKristenKehrer <34010022+KristenKehrer@users.noreply.github.com> Signed-off-by: 's avatarKristenKehrer <34010022+KristenKehrer@users.noreply.github.com> Co-authored-by: 's avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 's avatarDhruv Nair <dhruv.nair@gmail.com> Co-authored-by: 's avatarGlenn Jocher <glenn.jocher@ultralytics.com>
上级 1158a50a
...@@ -353,7 +353,14 @@ class CometLogger: ...@@ -353,7 +353,14 @@ class CometLogger:
metadata = logged_artifact.metadata metadata = logged_artifact.metadata
data_dict = metadata.copy() data_dict = metadata.copy()
data_dict["path"] = artifact_save_dir data_dict["path"] = artifact_save_dir
data_dict["names"] = {int(k): v for k, v in metadata.get("names").items()}
metadata_names = metadata.get("names")
if type(metadata_names) == dict:
data_dict["names"] = {int(k): v for k, v in metadata.get("names").items()}
elif type(metadata_names) == list:
data_dict["names"] = {int(k): v for k, v in zip(range(len(metadata_names)), metadata_names)}
else:
raise "Invalid 'names' field in dataset yaml file. Please use a list or dictionary"
data_dict = self.update_data_paths(data_dict) data_dict = self.update_data_paths(data_dict)
return data_dict return data_dict
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论