內建演算法的日誌 - Amazon SageMaker

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

內建演算法的日誌

Amazon SageMaker 演算法會產生 Amazon CloudWatch 日誌,提供訓練程序的詳細資訊。若要查看記錄檔,請在 AWS 管理主控台中選擇 CloudWatch,選擇 [記錄檔],然後選擇 /aws/sagemaker/ TrainingJobs 記錄群組。每一項訓練工作進行訓練的各節點都有一個日誌串流。日誌串流的名稱會以建立工作時 TrainingJobName 參數所指定的值為開頭。

注意

如果工作失敗且記錄未出現在中 CloudWatch,則很可能是在訓練開始前發生錯誤。原因包括訓練影像指定錯誤,或 S3 位置指定錯誤。

日誌的內會因演算法而異。不過一般可以看到下列資訊:

  • 日誌開頭對所提供的引數的確認

  • 訓練時發生的錯誤

  • 演算法準確度或數值效能的測量資料

  • 演算法的時間以及演算法的任何重要階段

常見錯誤

若訓練工作失敗,FailureReason 所提供的錯誤詳細資訊會在訓練工作描述中將值傳回,如下所示:

sage = boto3.client('sagemaker') sage.describe_training_job(TrainingJobName=job_name)['FailureReason']

其他只會在 CloudWatch 記錄檔中報告。常見錯誤包括下列項目:

  1. 超參數指定錯誤,或指定的超參數對該演算法無效。

    從日 CloudWatch 誌

    [10/16/2017 23:45:17 ERROR 139623806805824 train.py:48] Additional properties are not allowed (u'mini_batch_siz' was unexpected)
  2. 超參數指定的值無效。

    FailureReason

    AlgorithmError: u'abc' is not valid under any of the given schemas\n\nFailed validating u'oneOf' in schema[u'properties'][u'feature_dim']:\n {u'oneOf': [{u'pattern': u'^([1-9][0-9]*)$', u'type': u'string'},\n {u'minimum': 1, u'type': u'integer'}]}\

    FailureReason

    [10/16/2017 23:57:17 ERROR 140373086025536 train.py:48] u'abc' is not valid under any of the given schemas
  3. protobuf 檔案格式不正確。

    從日 CloudWatch 誌

    [10/17/2017 18:01:04 ERROR 140234860816192 train.py:48] cannot copy sequence with size 785 to array axis with dimension 784