# Problem when exporting Bert-Ner-Models to Onnx

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-when-exporting-bert-ner-models-to-onnx%2F92309%3E%5C
**Category:** Beginners\
**Created:** [June 15, 2024, 11:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-when-exporting-bert-ner-models-to-onnx%2F92309 "2024-06-15T11:48:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielAckermann3](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@DanielAckermann3](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FDanielAckermann3)%5C
**Post date:** [June 15, 2024, 11:48am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fproblem-when-exporting-bert-ner-models-to-onnx%2F92309%2F1 "2024-06-15T11:48:07Z")

</div>

By applying the code below the created onnx-model has as outputs:  
**logits → tensor: float32[batch\_size, 9]**

In my beginner-understanding the sequence\_length is missing!!!???  
 **→ tensor: float32[batch\_size, sequence\_length, 9]**

from optimum.onnxruntime import ORTModelForSequenceClassification  
model = ORTModelForSequenceClassification.from\_pretrained(“dslim/bert-base-NER”, export=True)  
model.save\_pretrained(“onnx/”)
