Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log_metric: raise helpful error if a nested metric is logged and parent key exists as a metric #492

Open
dberenbaum opened this issue Mar 7, 2023 · 2 comments
Labels
A: log_metric Area: `live.log_metric` p3-nice-to-have ui user interface / interaction

Comments

@dberenbaum
Copy link
Collaborator

This could happen without treating step as a metric. For example, even without step, you could get the same error for epoch here if you include epoch-level metrics.

We should fail in log_metric if a nested metric (foo/bar) is logged and any of the parent keys already exists in the summary.

Originally posted by @daavoo in #490 (comment)

@dberenbaum
Copy link
Collaborator Author

See #490 (comment) for more context.

@dberenbaum dberenbaum added A: log_metric Area: `live.log_metric` p3-nice-to-have labels Mar 7, 2023
@dberenbaum
Copy link
Collaborator Author

Summary: If you have already logged a metric like {"step": 0} and try to log a nested metric like {"step": {"loss": 0.5}}, you will get an error like:

  File "/Users/dave/Code/dvclive/src/dvclive/utils.py", line 35, in nested_update
    d[k] = nested_update(d.get(k, {}), v)
AttributeError: 'int' object has no attribute 'get'

@daavoo daavoo added the ui user interface / interaction label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: log_metric Area: `live.log_metric` p3-nice-to-have ui user interface / interaction
Projects
None yet
Development

No branches or pull requests

2 participants