@@ -82,6 +82,8 @@ def load(
8282 ):
8383 """Create a new ``Tracker`` by loading an existing trial component.
8484
85+ Note that `log_metric` will only work from a training job host.
86+
8587 Examples:
8688 .. code-block:: python
8789
@@ -142,7 +144,7 @@ def load(
142144 else :
143145 raise ValueError ('Could not load TrialComponent. Specify a trial_component_name or invoke "create"' )
144146
145- # if running in a SageMaker context write metrics to file
147+ # metrics require the metrics agent running on training job hosts
146148 if not trial_component_name and tce .environment_type == _environment .EnvironmentType .SageMakerTrainingJob :
147149 metrics_writer = metrics .SageMakerFileMetricsWriter ()
148150 else :
@@ -168,6 +170,8 @@ def create(
168170 ):
169171 """Create a new ``Tracker`` by creating a new trial component.
170172
173+ Note that `log_metric` will _not_ work when tracker is created this way.
174+
171175 Examples
172176 .. code-block:: python
173177
@@ -197,7 +201,10 @@ def create(
197201 sagemaker_boto_client = sagemaker_boto_client ,
198202 )
199203
200- metrics_writer = metrics .SageMakerFileMetricsWriter ()
204+ # metrics require the metrics agent running on training job hosts and in which case the load
205+ # method should be used because it loads the trial component associated with the currently
206+ # running training job
207+ metrics_writer = None
201208
202209 return cls (
203210 tc ,
@@ -364,7 +371,10 @@ def log_input_artifact(self, file_path, name=None, media_type=None):
364371 self ._lineage_artifact_tracker .add_input_artifact (name , s3_uri , etag , media_type )
365372
366373 def log_metric (self , metric_name , value , timestamp = None , iteration_number = None ):
367- """Record a scalar metric value for this TrialComponent to file, not SageMaker.
374+ """Record a scalar metric value for this TrialComponent.
375+
376+ Note that metrics logged with this method will only appear in SageMaker when this method
377+ is called from a training job host.
368378
369379 Examples
370380 .. code-block:: python
0 commit comments