Preparing the entrypoint PyTorch inference script
In the previous recipe, we prepared the entrypoint
training script to train a PyTorch model. In this recipe, we will prepare the entrypoint
inference script to deploy a PyTorch model with SageMaker as we will see in the next recipe.
If you are planning to migrate your custom PyTorch neural network code and perform training and deployment with the SageMaker platform, then this recipe, the previous one, and the next one are for you!
Getting ready
This recipe continues from Preparing the entrypoint PyTorch training script.
How to do it
The instructions in this recipe focus on preparing the inference entrypoint
script. Let's start by creating an empty file named pytorch_inference.py
inside the Jupyter notebook instance and proceed with the next set of steps:
- Navigate to the
/ml-experients/chapter03/PyTorch
directory.We can see in...