How is the entry point to the code specified in bring your own code?
I'm trying out the sample notebooks, currently in the mxnet mnist example which demonstrates bringing your own code. The entry point parameter passed in when instantiating an estimator instance, only mentions the source file (mnist.py) and not a method name or any other point inside the source file. So how does sagemaker figure out which method to send the training data to?
You should have a executable program name as "train". Sagemaker will search it by PATH.
Thanks @Katniss394 for your question, and thanks @ThisIsRick for jumping in and helping answer!
As a bit more background... For the bring-your-own-algorithm use case, yes, SageMaker will look to run an executable program named "train" for training and "serve" for hosting. This example provides more detail on that. Or, alternatively, you can specify any ENTRYPOINT in your Dockerfile which has train() and serve() functions defined within. Then you can parse the command line options for "train" or "serve" to execute the right function. An example for that is here.
For the MXNet examples, we've provided the container for you. In this case, MXNet expects the source file that you pass to the MXNet estimator to have a "train()" function defined. This is the function it will automatically run when training begins. Note, your train() function can other functions or classes by including them in the same source file. More documentation on using the pre-built MXNet containers can be found here.
Thanks!
Thank you guys!