- Newest
- Most votes
- Most comments
Thanks for raising this. Yes, as you point out the Environment
collection is not supported in the underlying CreateHyperparameterTuningJob
API and therefore the SageMaker Python SDK can't make use of it when running a tuner.
As discussed on the SM Py SDK GitHub issue here, you might consider using hyperparameters instead to pass parameters through to the job?
If you specifically need environment variables for some other process/library, you could also explore setting the variables from your Python script (perhaps to map from hyperparam to env var?).
Or another option could be to customize your container image to bake in the variable via the ENV command? For example to customize an existing AWS Deep Learning Container (framework container), you could:
- Use
sagemaker.image_uris.retrieve(...)
to find the base image URI for your given framework, version, region, etc. You'll need to authenticate Docker to this registry as well as your own Amazon ECR account. - Create a Dockerfile that takes this base image URI as an arg and builds
FROM
it, something like this example - Add the required
ENV
commands to bake in the (static) environment variables you need docker build
your custom container (passing in the base image URI as a--build-arg
), upload it to Amazon ECR, and use in your SageMaker training job.
Relevant content
- asked 3 years ago
- asked a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 3 years ago