# Problem when exporting Bert-Ner-Models to Onnx

**URL:** <https://discuss.huggingface.co/t/problem-when-exporting-bert-ner-models-to-onnx/92309>\
**Category:** Beginners\
**Created:** [June 15, 2024, 11:48am UTC](https://discuss.huggingface.co/t/problem-when-exporting-bert-ner-models-to-onnx/92309 "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](https://discuss.huggingface.co/u/DanielAckermann3)\
**Post date:** [June 15, 2024, 11:48am UTC](https://discuss.huggingface.co/t/problem-when-exporting-bert-ner-models-to-onnx/92309/1 "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/”)
