aws / aws/amazon-sagemaker-examples

No pth file found for PyTorch model

Open
#986 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

Hello,

I am having issues while compiling my Pytorch model (trained on Sagemaker) with Neo. I have the following code:

```
pytorch_model = PyTorchModel(
model_data=model_data,
role=role,
sagemaker_session=sagemaker_session,
framework_version='1.2.0',
name='code-detector-model',
entry_point='sagemaker-model-entry.py',
source_dir='./',
predictor_cls=ImagePredictor,
)

pytorch_model.compile(
role=role,
target_instance_family='ml_c5',
input_shape={'data': [1, 3, 1024, 1024]},
output_path='s3://sagemaker-compiled',
job_name='compile-sagemaker-1',
framework='pytorch',
)
```

Which results in the following error:

```
UnexpectedStatusException: Error for Compilation job compile-sagemaker-1: Failed. Reason: ClientError: InputConfiguration: No pth file found for PyTorch model. Please make sure the framework you select is correct.
```

which would make you think that it can't find the model's weight file.. however, I have deployed an endpoint and successfully ran inference against the same model so that can't be the case.

Super stuck, any help would be greatly appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.