aws / aws/amazon-sagemaker-examples

[mxnet_mnist_byom] How can I import mxnet model for inference only?

Open
#1,062 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

I have two questions on bring-your-own-mxnet model for inference only.
I followed the mxnet_mnist_byom example:
https://github.com/awslabs/amazon-sagemaker-examples/tree/master/advanced_functionality/mxnet_mnist_byom

1. Why do we need `mnist.py` as the `entry_point` while importing the model into SageMaker?

```
from sagemaker.mxnet.model import MXNetModel
sagemaker_model = MXNetModel(model_data = 's3://' + sagemaker_session.default_bucket() + '/model/model.tar.gz',
role = role,
entry_point = 'mnist.py')
```
In the `mnist.py`, I find there are only training related code blocks.
https://github.com/awslabs/amazon-sagemaker-examples/blob/master/advanced_functionality/mxnet_mnist_byom/mnist.py

Which part of `mnist.py` is essential for inference?

2. Will it work with .params only tar.gz?
From https://mxnet.apache.org/api/python/docs/tutorials/packages/gluon/blocks/save_load_params.html , I find the non-hybrid model cannot export a .json architecture file.

Can a params only `model.tar.gz` in s3 bucket be imported for inference into SageMaker?

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start with the advanced_functionality/mxnet_mnist_byom example, especially mnist.py and the MXNetModel construction shown in the issue. Trace which parts support inference and check the linked MXNet save/load guidance for params-only archives. Done means documenting clear answers to both questions in the example or its documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, jupyter-notebook, python
Domain
cloud, documentation, machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.