1

I’ve been trying to use Sagemaker to run my custom MXNet training job. In all the examples I’ve seen, the code sample looks like this

estimator = MXNet(‘train.py’, role=role, other_params)
estimator.fit(inputs)



What if my train.py relies on a custom module? Given a directory structure like so

.
├── awesome
│   ├── __init__.py
│   └── lib.py
└── train.py 

With my train.py file importing from awesome/lib.py, what’s the best way for me to deploy this job on Sagemaker without going through the hassle of creating a Docker container.

Note: all the code in the custom module is just regular mxnet code, organized across various files and helper methods

1 Answers1

0

You can use the parameters source_dir to point to the code location, and a requirements.txt file to add dependencies. This will avoid to touch docker at all. You can see those parameters in the SDK documentation ("Use third party library"), they are available both for training and deployment. See here an mxnet deployment example with additional dependencies in a requirements.txt

https://github.com/aws-samples/sagemaker-yolov3-detection-server/blob/master/mxnet_detection_serving.ipynb

Olivier Cruchant
  • 3,747
  • 15
  • 18