对 Neo 编译错误进行问题排查 - Amazon SageMaker
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

对 Neo 编译错误进行问题排查

此部分包含的信息是关于如何了解和预防常见错误,这些错误所生成的错误消息以及如何解决这些错误的指南。

如何使用此页

尝试按以下顺序浏览这些部分来解决您的错误:

  1. 检查编译作业的输入是否满足输入要求。请参阅 SageMaker Neo 需要什么输入数据形状?

  2. 查看常见的框架特定的错误

  3. 查看您的错误是否是基础设施错误

  4. 查看您的编译日志

错误 解决方案

InputConfiguration: No h5 file provided in <model path>

检查您的 h5 文件是否在您指定的 Amazon S3 URI 中。

或者

检查 h5 文件格式是否正确

InputConfiguration: Multiple h5 files provided, <model path>, when only one is allowed

检查您是否只提供了一个 h5 文件。

ClientError: InputConfiguration: Unable to load provided Keras model. Error: 'sample_weight_mode'

检查您指定的 Keras 版本是否受支持。请参阅云实例边缘设备支持的框架。

ClientError: InputConfiguration: Input input has wrong shape in Input Shape dictionary. Input shapes should be provided in NCHW format.

检查您的模型输入是否遵循 NCHW 格式。请参阅 SageMaker Neo 需要什么输入数据形状?

错误 解决方案

ClientError: InputConfiguration: Only one parameter file is allowed for MXNet model. Please make sure the framework you select is correct.

SageMaker Neo 将选择给出的第一个参数文件进行编译。

错误 解决方案

InputConfiguration: Exactly one .pb file is allowed for TensorFlow models.

确保您只提供一个.pb 或.pbtxt 文件。

InputConfiguration: Exactly one .pb or .pbtxt file is allowed for TensorFlow models.

确保您只提供一个.pb 或.pbtxt 文件。

ClientError: InputConfiguration: TVM cannot convert <model zoo> model. Please make sure the framework you selected is correct. The following operators are not implemented: {<operator name>}

检查您选择的运算符是否受支持。请参阅 SageMaker Neo 支持的框架和运算符

错误 解决方案

InputConfiguration: We are unable to extract DataInputConfig from the model due to input_config_derivation_error. Please override by providing a DataInputConfig during compilation job creation.

请执行以下任一操作:

  • 通过在编译请求中提供 DataInputConfig 定义来指定预期输入的名称和形状。

  • 调查 Amazon CloudWatch Logs 的错误。检查 /aws/sagemaker/CompilationJobs 日志组并查找名为 compilationJobName/model-info-extraction 的日志流。

基础设施相关错误

错误 解决方案

ClientError: InputConfiguration: S3 object does not exist. Bucket: <bucket>, Key: <bucket key>

请查看您提供的 Amazon S3 URI。

ClientError: InputConfiguration: Bucket <bucket name> is in region <region name> which is different from Amazon Sagemaker service region <service region>

创建与服务位于同一区域中的 Amazon S3 存储桶。

ClientError: InputConfiguration: Unable to untar input model. Please confirm the model is a tar.gz file

检查 Amazon S3 中的模型是否已压缩成 tar.gz 文件。

查看您的编译日志

  1. 导航到 Amazon CloudWatch,网址为 https://console.aws.amazon.com/cloudwatch/

  2. 从右上角的区域下拉列表中选择您创建编译作业的区域。

  3. 在 Amazon CloudWatch 的导航窗格中,选择日志。选择日志组

  4. 搜索名为 /aws/sagemaker/CompilationJobs 的日志组。选择日志组。

  5. 搜索以编译作业名称命名的日志流。选择日志流。