- Newest
- Most votes
- Most comments
It's not exactly clear from the question, but I'm guessing the error you see is that the unresolved "$.JobDetails.Var"
string is what gets passed through to your job?
Unlike in TrainingJobName.$
, you haven't ended the parameter name with .$ for ContainerArguments.$
, to indicate that it's a pathspec.
However since this field is an array, I believe you'll need to use this trick for something like:
ContainerArguments.$: "States.Array('--var', $.JobDetails.Var)"
Unfortunately I don't have a similar complete example to hand to easily test with.
For what it's worth, you may prefer to use the HyperParameters
dictionary for this? Hyperparams are more broadly visible in SageMaker console & UIs than container arguments - and would be eligible for things like automatic HP tuning later if you wanted to use that. Provided hyperparameters should get automatically written into a /opt/ml/input/config/hyperparameters.json
file in your container.
If you wanted, you could use the sagemaker-training-toolkit in your custom container to load environment variables & run your script with hyperparam CLI arguments like SageMaker Script Mode does. If you're already using one of the AWS-provided framework images, they'll already have something like this (might be slightly different e.g. the sagemaker-pytorch-training-toolkit or similar).
Relevant content
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated a year ago
- How can I use a Lambda function to automatically start an AWS Glue job when a crawler run completes?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 22 days ago
- AWS OFFICIALUpdated a month ago
The States.Array trick solved it! Thank you for the detailed explanation.