# Issue with Inference API for ViT Model - "image-feature-extraction" Error

**URL:** <https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246>\
**Category:** Inference Endpoints on the Hub\
**Created:** [March 20, 2024, 10:39am UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246 "2024-03-20T10:39:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rshrott](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rshrott](https://discuss.huggingface.co/u/rshrott)\
**Post date:** [March 20, 2024, 10:39am UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/1 "2024-03-20T10:39:21Z")

</div>

I’m experiencing an issue with the inference API for my Vision Transformer (ViT) model, rshrott/vit-base-renovation2.

> **[rshrott/vit-base-renovation2 · Hugging Face](https://huggingface.co/rshrott/vit-base-renovation2)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

When I attempt to use the API, I receive the following error:

{  
“error”: "HfApiJson(Deserialize(Error(“unknown variant `image-feature-extraction`, expected one of `audio-classification`, `audio-to-audio`, `audio-source-separation`, `automatic-speech-recognition`, `feature-extraction`, `text-classification`, `token-classification`, `question-answering`, `translation`, `summarization`, `text-generation`, `text2text-generation`, `fill-mask`, `zero-shot-classification`, `zero-shot-image-classification`, `conversational`, `table-question-answering`, `image-classification`, `image-segmentation`, `image-to-text`, `text-to-speech`, … `visual-question-answering`, `video-classification`, `document-question-answering`, `image-to-image`, `depth-estimation`, line: 1, column: 318)))”  
}

Interestingly, when I use the transformers pipeline directly in Python, the model works as expected:

from transformers import pipeline  
from PIL import Image  
import requests

pipe = pipeline(model=“rshrott/vit-base-renovation2”)  
url = ‘[https://example.com/image.jpeg](https://example.com/image.jpeg)’  
image = Image.open(requests.get(url, stream=True).raw)  
preds = pipe(image)

This code runs without any issues and returns the expected predictions. However, the same model encounters an error when used through the inference API. I suspect there might be a configuration issue related to the expected task type, but I’m not sure how to resolve it.

Could you please help me understand why this error is occurring and how I can fix it? I’ve checked the model card and configuration, but I can’t seem to find where “image-feature-extraction” is coming from or why it’s expected.

Thank you for your assistance!

---

<div class="post-metadata">

**Author:** ![ahmedesmail16](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@ahmedesmail16](https://discuss.huggingface.co/u/ahmedesmail16)\
**Post date:** [April 13, 2024, 9:33pm UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/2 "2024-04-13T21:33:56Z")

</div>

**Did you find the solution ? Because I am facing the same problem**

---

<div class="post-metadata">

**Author:** ![motheecreator](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@motheecreator](https://discuss.huggingface.co/u/motheecreator)\
**Post date:** [May 25, 2024, 2:22pm UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/3 "2024-05-25T14:22:50Z")

</div>

i faced the same error, did you solve it?

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [May 27, 2024, 10:00am UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/4 "2024-05-27T10:00:03Z")

</div>

Thanks for reporting, have forwarded it to the team.

---

<div class="post-metadata">

**Author:** ![motheecreator](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@motheecreator](https://discuss.huggingface.co/u/motheecreator)\
**Post date:** [May 31, 2024, 2:56am UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/5 "2024-05-31T02:56:40Z")

</div>

I think I figured it out. Even though it seems ridiculous, when I removed the YAML metadata from the README.md, it worked. 😄

---

<div class="post-metadata">

**Author:** ![osanseviero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/osanseviero/32/38738_2.png) [@osanseviero](https://discuss.huggingface.co/u/osanseviero)\
**Post date:** [May 31, 2024, 8:46am UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/6 "2024-05-31T08:46:27Z")

</div>

Hi all! The issue was due to the base\_model being pointed and a parsing error with this specific model. We’re fixing things on our side, it should work soon 🙂

---

<div class="post-metadata">

**Author:** ![remax21](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/remax21/32/30863_2.png) [@remax21](https://discuss.huggingface.co/u/remax21)\
**Post date:** [June 7, 2024, 4:25pm UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/7 "2024-06-07T16:25:29Z")

</div>

Any updates 😊 ?

---

<div class="post-metadata">

**Author:** ![raphael-gl](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@raphael-gl](https://discuss.huggingface.co/u/raphael-gl)\
**Post date:** [June 7, 2024, 11:17pm UTC](https://discuss.huggingface.co/t/issue-with-inference-api-for-vit-model-image-feature-extraction-error/78246/8 "2024-06-07T23:17:43Z")

</div>

Hi 🙂  
The fix has been deployed.
