0
votes

I am wondering why I am unable to show the loss and accuracy curve in Sagemaker Studio, Trial components chart.

I am using tensorflow's keras API for training.

from sagemaker.tensorflow import TensorFlow


estimator = TensorFlow(
    entry_point="sm_entrypoint.sh",
    source_dir=".",
    role=role,
    instance_count=1,
    instance_type="ml.m5.4xlarge",
    framework_version="2.4",
    py_version="py37",
    metric_definitions=[
            {'Name':'train:loss', 'Regex':'loss: ([0-9.]+'},
            {'Name':'val:loss', 'Regex':'val_loss: ([0-9.]+'},
            {'Name':'train:accuracy', 'Regex':'accuracy: ([0-9.]+'},
            {'Name':'val:accuracy', 'Regex':'val_accuracy: ([0-9.]+'}
        ],
    enable_sagemaker_metrics=True
)
 

estimator.fit(
    inputs="s3://xxx",
    experiment_config={
        "ExperimentName": "urbansounds-20211027",
        "TrialName": "tf-classical-NN-20211027",
        "TrialComponentDisplayName": "Train"
    }
)

Regex is enabled, and appears to be logging them correctly. Since under the metrics tab, it shows 12 counts for each metric, corresponding to 12 epochs cycle which I specified.

enter image description here

However, the chart is empty. The x-axis is in time here, but it is also empty when I switched to epoch.

enter image description here