# Sagemaker serverless endpoint deployment error (Image size greater than support size))

**URL:** <https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560>\
**Category:** Amazon SageMaker\
**Created:** [July 21, 2023, 3:50am UTC](https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560 "2023-07-21T03:50:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tung18078](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tung18078](https://discuss.huggingface.co/u/tung18078)\
**Post date:** [July 21, 2023, 3:50am UTC](https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560/1 "2023-07-21T03:50:28Z")

</div>

Halo guys,

I experienced UnexpectedStatusException when trying deploying a model to serverless endpoint.

```python
huggingface_model = HuggingFaceModel(
    model_data="s3://path/model.tar.gz",
    role=role,
    py_version="py310",
    transformers_version="4.28.1",
    pytorch_version="2.0.0",
)
serverless_config = ServerlessInferenceConfig(memory_size_in_mb=4096,
                                              max_concurrency=10,
                                              )
predictor = huggingface_model.deploy(serverless_inference_config = serverless_config)

```

The error message is:

> UnexpectedStatusException: Error hosting endpoint huggingface-pytorch-inference-2023-07-21-03-29-12-789: Failed. Reason: Image size 13884113136 is greater than supported size 10737418240.

Seems the Image size is larger than the image limit 10GB

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [July 21, 2023, 9:18am UTC](https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560/2 "2023-07-21T09:18:02Z")

</div>

Yes. Whats your question?

---

<div class="post-metadata">

**Author:** ![tung18078](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tung18078](https://discuss.huggingface.co/u/tung18078)\
**Post date:** [July 21, 2023, 9:56am UTC](https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560/3 "2023-07-21T09:56:52Z")

</div>

Hi @philschmid,

I just want to know if this Huggingface DLC can be deployed in serverless endpoint.

And, my current model size is 2.2GB which is uploaded to S3, does it account for the image space which led the image size over 10GB limit.

Thanks.

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [July 21, 2023, 12:00pm UTC](https://discuss.huggingface.co/t/sagemaker-serverless-endpoint-deployment-error-image-size-greater-than-support-size/47560/4 "2023-07-21T12:00:21Z")

</div>

Yes see: [Serverless Inference with Hugging Face's Transformers, DistilBERT and Amazon SageMaker](https://www.philschmid.de/sagemaker-serverless-huggingface-distilbert)
