# HuggingFaceModel create fails with no GPU

**URL:** <https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162>\
**Category:** Amazon SageMaker\
**Created:** [June 13, 2025, 2:46pm UTC](https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162 "2025-06-13T14:46:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurb](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@laurb](https://discuss.huggingface.co/u/laurb)\
**Post date:** [June 13, 2025, 2:46pm UTC](https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162/1 "2025-06-13T14:46:23Z")

</div>

I have a pretrained custom model with the model.tar.gz file located in S3. I want to create the HuggingFaceModel and the endpoint configuration in Sagemaker. My local machine (where I am running this) does not have a GPU, but the model will be deployed on a GPU instance in Sagemaker. When I try:

# create Hugging Face Model Class

huggingface\_model = HuggingFaceModel(  
model\_data=s3\_location, # path to your model and script  
role=role, # iam role with permissions to create an Endpoint  
transformers\_version=“4.37”, # transformers version used  
pytorch\_version=“2.1”, # pytorch version used  
py\_version=‘py310’, # python version used  
name=‘cjk-model-1’,  
}

I get an error this error,  
None of PyTorch, TensorFlow \>= 2.0, or Flax have been found. Models won’t be available and only tokenizers, configuration and file/data utilities can be used.

but I don’t understand why I should need pytorch since the model is already trained and it will run on Sagemaker?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 13, 2025, 3:54pm UTC](https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162/2 "2025-06-13T15:54:53Z")

</div>

Transoformers library is essentially a wrapper that uses PyTorch or TensorFlow as its backend, so PyTorch is absolutely necessary.

For example, the model class inherits from `torch.nn.Modules` basically…

> [@Setting up environment in Sagemaker Studio](https://discuss.huggingface.co/t/setting-up-environment-in-sagemaker-studio/32998):
>
> Hello everyone, I am currently working on finetuning a DETR object detection model in Sagemaker Studio using a Hugging Face Estimator. I have installed the libraries with pip, as shown below: !pip install transformers datasets huggingface\_hub evaluate timm albumentations wandb sagemaker However, when I tried to check the versions of Pytorch and transformers inside the SageMaker Studio notebook, I got the following error: import torch print(torch.\_\_version\_\_) \>\>\>ModuleNotFoundError: No module…

[https://stackoverflow.com/questions/64337550/neither-pytorch-nor-tensorflow-2-0-have-been-found-models-wont-be-available](https://stackoverflow.com/questions/64337550/neither-pytorch-nor-tensorflow-2-0-have-been-found-models-wont-be-available)

---

<div class="post-metadata">

**Author:** ![laurb](https://avatars.discourse-cdn.com/v4/letter/l/e47c2d/32.png) [@laurb](https://discuss.huggingface.co/u/laurb)\
**Post date:** [June 13, 2025, 9:15pm UTC](https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162/3 "2025-06-13T21:15:28Z")

</div>

but Pytorch is used by the model/inference code, which is already wrapped into the model, and the huggingface image on sagemaker includes it, so why does the machine I’m deploying from require it?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 14, 2025, 12:53am UTC](https://discuss.huggingface.co/t/huggingfacemodel-create-fails-with-no-gpu/159162/4 "2025-06-14T00:53:30Z")

</div>

That’s true. What’s going on? For example, maybe SageMaker’s GPU has been updated and the old PyTorch is no longer compatible…?

```auto
pytorch_version=“2.4”, # pytorch version used

```

> **[Running Any HuggingFace Model on SageMaker Endpoint: Walk-Through with Cross...](https://huggingface.co/blog/kchoe/deploy-any-huggingface-model-to-sagemaker)**
>
> A Blog post by Kenny Choe on Hugging Face
