aws-step-functions-data-science-sdk-python
aws-step-functions-data-science-sdk-python copied to clipboard
ModelDataUrl is incorrect when result_path is defined in TrainingStep
trafficstars
The ModelDataUrl in the Step Functions' defenition is '“ModelDataUrl.$“: “$[‘ModelArtifacts’][‘S3ModelArtifacts’]”' even though the result_path is defined in the TrainingStep, and it causes error like this.
“An error occurred while executing the state ‘Save Model’ (entered at the event id #8). The JSONPath ’$[‘ModelArtifacts’][‘S3ModelArtifacts’]' specified for the field ‘ModelDataUrl.$’ could not be found in the input ...
It should be '“ModelDataUrl.$“: “$[‘TrainingStepResults’][‘ModelArtifacts’][‘S3ModelArtifacts’]”'.
training_step = steps.TrainingStep(
‘Model Training’,
estimator=tf_estimator,
data={
‘training’: inputs
},
job_name=execution_input[‘TrainingJobName’],
result_path=‘$.TrainingStepResults’,
wait_for_completion=True
)
model_step = steps.ModelStep(
‘Save Model’,
model=training_step.get_expected_model(),
model_name=execution_input[‘ModelName’],
instance_type=‘ml.m5.xlarge’,
result_path=‘$.ModelStepResults’
)