内置算法的日志 - Amazon SageMaker
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

内置算法的日志

Amazon SageMaker 算法生成 Amazon CloudWatch 日志,这些日志提供了有关训练过程的详细信息。要查看日志,请在 Amazon 管理控制台中,选择 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