-
Notifications
You must be signed in to change notification settings - Fork 35
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() raises warning, doesn't reflect in trial component #75
Comments
Can't see log_metric() and see the stored data through the SMExperiments API/UI log_metric only logs to file currently. Eventually metrics will be logged server side and visible in API/UI, but no ETA. ERROR:root:'NoneType' object has no attribute 'write' This error was an indicator of the lazy-instantiation of the file writer and fixed in #76 |
@danabens That said, I've seen that log_metric does send the results to sagemaker, and can be queries with SageMaker Analytics. However, this seem to be inconsistent. |
Agreed - as far as I can tell it only logs to a JSON file created in the same directory? I'm not sure I understand the use case for that functionality..? +1 for getting SageMaker-side metric logging ASAP: There are custom output metrics (not parameters) of my Trial Components that I'd like to track as part of the SageMaker Experiment... E.g. per-field summary statistics after some pre-processing in a notebook or Processing Job. |
the file metrics writer writes to a file named .json . optionally, the environment variable SAGEMAKER_METRICS_DIRECTORY will determine the directory where the file is wriitten. code is here.
|
We recently fixed a metrics file buffering issue that may be related: bd48bdc |
Both issues (warning and not seeing metrics) are fixed and released. Let us know if you encounter any further issues. |
Describe the bug
(Possibly related to #72 but I'm specifically working in SageMaker Studio)
Explicit
Tracker.log_metric()
calls raise a warning (see details below) and don't seem able to send metric data to SageMaker Experiments.I've tried various combinations of:
Experiment.save()
,Trial.save()
,TrialComponent.save()
to flush metrics through to the APIwith Tracker.create(...) as tracker:
block in case being inside the context was necessary to log correctly...but haven't found any working combination where I can explicitly call
log_metric()
and see the stored data through the SMExperiments API/UI.To Reproduce
From a SageMaker Studio Python 3 (Data Science) kernel notebook:
The last log_metric line seems to raise the following warning (not Exception):
Input and output artifacts and parameters seem to be recorded and visible no problem, and a local
{PID}.json
file is generated but metrics are not visible through the Experiments APIs/UI.tracker_nowith.trial_component.metrics
returnsNone
Expected behavior
log_metric()
to record the submitted named, scalar metric which should become visible throughTrialComponent.metrics
and the SageMaker Studio Experiments UI.Screenshots
None
Environment:
Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): None
Framework Version: N/A
Python Version: 3.7.6
CPU or GPU: ml.t3.medium
Python SDK Version: smexperiments 0.1.14, sagemaker 1.60.0
Are you using a custom image: No - SMStudio Data Science kernel
Additional context
Use case is to record summary metrics derived from an in-notebook data preprocessing step: E.g. number of features after processing, summary statistics, etc.
The text was updated successfully, but these errors were encountered: