Running custom scripts in a custom container while running a sagemaker training job

Viewed 26

I am currently in the process of setting up a custom sagemaker container to run training jobs on Sagemaker and have succeeded in doing so. However, I am a bit confused over this question which is currently bugging me and is definitely something that I need to consider in the future

  1. Is it possible to run custom scripts on a custom container when declaring a sagemaker training job?

My current understanding when it comes to creating a custom sagemaker image is that I create a train file that gets executed when running a training job, but I could never find documentation on whether is it possible to overwrite this and run a training script (but using the same custom container), like how we run training jobs using in-built algorithms. Is it the case that for custom algorithms we are restricted by this limitation?

1 Answers

I don't fully understand your question (can you make an example please?), specially when you say

like how we run training jobs using in-built algorithms

But basically you can do whatever you want in your container, as probably you already did, you have a proper train file in your container, which is the one that sagemaker calls as the entrypoint. In that file you can call external script (which are in your container too) and also pass parameters to your container (see how for example hyperparameters are passed). There is a quite clear documentation here.

Related