IncompleteSignature error while using Sklearn SDK

0

Currently, we are trying to SK-Learn model from a python script running in a local computer by uploading data to S3 bucket.

from sagemaker.amazon.amazon_estimator import get_image_uri
# container = retrieve(framework='sklearn', region='us-east-1', version="0.23-1")
container = sagemaker.image_uris.get_training_image_uri('us-east-1', 'sklearn', framework_version='0.23-1') 
sklearn_estimator = SKLearn(
    entry_point="script.py",
    # # role=get_execution_role(),
    role = role_aws,
    instance_count=1,
    instance_type="ml.m5.4xlarge",
    framework_version=FRAMEWORK_VERSION,
    base_job_name="rf-scikit",
    metric_definitions=[{"Name": "median-AE", "Regex": "AE-at-50th-percentile: ([0-9.]+).*$"}],
    hyperparameters={
        "n-estimators": 100,
        "min-samples-leaf": 3,
        "features": "MedInc HouseAge AveRooms AveBedrms Population AveOccup Latitude Longitude",
        "target": "target",
    },
    sagemaker_session=session,
    image_uri=container,
    image_uri_region='us-east-1',
    # output_path=model_output_path,
)
# launch training job, with asynchronous call
path_train_test = 's3://'+bucket_name+'/'+prefix
sklearn_estimator.fit({"train": path_train_test, "test": path_train_test}, wait=False)

'ClientError: An error occurred (IncompleteSignature) when calling the GetCallerIdentity operation: Credential must have exactly 5 slash-delimited elements, e.g. keyid/date/region/service/term, got 'https://elasticmapreduce.us-east-1b.amazonaws.com//20220406/us-east-1/sts/aws4_request' The access key and the secret key are passed through the session object via a client and passed to the SK-Learn estimator.

client_sagemaker = boto3.client('sagemaker', 
                  aws_access_key_id=accesskey , 
                  aws_secret_access_key=access_secret,
                  )
session = sagemaker.Session(sagemaker_client =client_sagemaker )

The same access key worked for Xgboost model (already available in sagemaker) Any ideas about the reason ?

질문됨 2년 전89회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠