简体   繁体   中英

CreateModel operation: Could not find model data at s3://my-bucket/testing/model/output/model.tar.gz

I am Able to train my model

Below is the code

from sagemaker.estimator import Estimator
estimator_new = Estimator(image_name=ecrimage,
                          role=role,
                          train_instance_count=1,
                          train_instance_type='ml.c4.xlarge',
                          output_path="s3://my-bucket/testing",
                          sagemaker_session = sagemaker_session)

Model Fitting

estimator_new.fit()

But when i am trying to deploy model getting this below error

Deploy code is:

Multiple_linear_regressor_tens=estimator_new.deploy(initial_instance_count=1,
                               instance_type='ml.m4.xlarge')

Error message is

ClientError: An error occurred (ValidationException) when calling the CreateModel operation: Could not find model data at s3://my-bucket/testing/model/output/model.tar.gz.

Please help me to resolve this issue

Was your training job successfully completed? If so, did you see the output model data in your specified output_path ? (Also please make sure your output path exists otherwise sagemaker will create a location instead: https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/estimator.py#L136 )

When you were trying to deploy the model to an endpoint, were you able to find the model information from the SageMaker Endpoint console, and does it have your model data location points to the output_path you specified?

If you are encountering this error in script mode, your .py entrypoint needs to have a model_fn(..) that returns the saved model. See an example here: script mode xgboost example .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM