ultralytics 8.0.188 fix .grad attribute leaf Tensor Warning (#5094)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
f2ed207571
commit
19c3314e68
11 changed files with 78 additions and 41 deletions
|
|
@ -327,8 +327,9 @@ def yaml_save(file='data.yaml', data=None, header=''):
|
|||
file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Convert Path objects to strings
|
||||
valid_types = int, float, str, bool, list, tuple, dict, type(None)
|
||||
for k, v in data.items():
|
||||
if isinstance(v, Path):
|
||||
if not isinstance(v, valid_types):
|
||||
data[k] = str(v)
|
||||
|
||||
# Dump data to file in YAML format
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue