aws-step-functions-data-science-sdk-python icon indicating copy to clipboard operation
aws-step-functions-data-science-sdk-python copied to clipboard

ModelDataUrl is incorrect when result_path is defined in TrainingStep

Open ohbuchim opened this issue 5 years ago • 0 comments
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’
)

ohbuchim avatar Nov 09 '20 10:11 ohbuchim