I am trying to create AWS Sagemaker Pipeline. I created this pipeline 2 months back and it was running then. But now I am getting following error on running
pipeline.upsert(role_arn=role)
ClientError: An error occurred (ValidationException) when calling the CreatePipeline operation: Unknown property reference [Parameters.DataSplitPercent].
Following is the some code written to create pipeline:
Input_data =ParameterString(name="InputDataUrl",default_value=f"s3://akgargbucket/iris.data")<br/>
data_split_percent = ParameterFloat(name="DataSplitPercent", default_value=0.7)<br/>
framework_version="0.23-1",
instance_type=processing_instance_type,
instance_count=processing_instance_count,
base_job_name=f"{base_job_prefix}/sklearn-abalone-preprocess",
sagemaker_session=sagemaker_session,
role=role)
step_process = ProcessingStep(
name="ReadAndEncodeData",
processor=sklearn_processor,
outputs=[
ProcessingOutput(output_name="train", source="/opt/ml/processing/train"),
ProcessingOutput(output_name="test", source="/opt/ml/processing/test"),
],
code=os.path.join(BASE_DIR, "preprocess.py"),
job_arguments=["--input-data", input_data,
"--data_split_percent",data_split_percent])
CodePudding user response:
What version of the SageMaker Python SDK are you using?
import sagemaker
print(sagemaker.__version__)
I suggest testing by installing the latest version.
!pip install sagemaker --upgrade
CodePudding user response:
I updated data_split_percent to data_split_percent = ParameterString(name="DataSplitPercent", default_value="0.7") and the preprocess.py file data_split_percent is read as float. Then, I restarted the kernel of my sagemaker notebook through which I was creating and running the pipeline. It started working fine.