Use Neo to Compile a Model - Amazon SageMaker

Use Neo to Compile a Model

This section shows how to create, describe, stop, and list compilation jobs. The following options are available in Amazon SageMaker Neo for managing the compilation jobs for machine learning models: the Neo CLI, the Amazon SageMaker console, or the Amazon SageMaker SDK.

What input data shapes does SageMaker Neo expect?

Before you compile your model, make sure you model is formatted correctly. Neo expects the name and shape of the expected data inputs for your trained model with JSON format or list format. The expected inputs are framework specific.

Below are the input shapes SageMaker Neo expects:

Specify either the name and shape (NHWC format) of the expected data inputs using a dictionary format for your trained model. The dictionary formats required are as follows:

  • For one input: {'input':[1,1024,1024,3]}

  • For two inputs: {'data1': [1,28,28,1], 'data2':[1,28,28,1]}

Specify either the name and shape (NCHW format) of expected data inputs using a dictionary format for your trained model. Note that while Keras model artifacts should be uploaded in NHWC (channel-last) format, DataInputConfig should be specified in NCHW (channel-first) format. The dictionary formats required are as follows:

  • For one input: {'input_1':[1,3,224,224]}

  • For two inputs: {'input_1': [1,3,224,224], 'input_2':[1,3,224,224]}

Specify either the name and shape (NCHW format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required are as follows:

  • For one input: {'data':[1,3,1024,1024]}

  • For two inputs: {'var1': [1,1,28,28], 'var2':[1,1,28,28]}

Specify either the name and shape (NCHW format) of expected data inputs in order using a dictionary format for your trained model or you can specify the shape only using a list format. The dictionary formats required are are as follows:

  • For one input in dictionary format: {'input0':[1,3,224,224]}

  • For one input in list format: [[1,3,224,224]]

  • For two inputs in dictionary format: {'input0':[1,3,224,224], 'input1':[1,3,224,224]}

  • For two inputs in list format: [[1,3,224,224], [1,3,224,224]]

input data name and shape are not needed.

Specify either the name and shape (NHWC format) of the expected data inputs in order using a dictionary format for your trained model. The dictionary formats required are as follows:

  • For one input: {'input':[1,224,224,3]}