GLiNER icon indicating copy to clipboard operation
GLiNER copied to clipboard

ONNX reshape error when running inference with GLiNER-PII-Edge v1.0

Open Ani2019 opened this issue 4 months ago • 1 comments

Hello,

I’m trying to use GLiNER-PII-Edge v1.0 model from Hugging Face https://huggingface.co/knowledgator/gliner-pii-edge-v1.0/tree/main ,(inference with onnx file) with onnxruntime, but I’m encountering a reshape error. I would appreciate your help. This is the error: onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Reshape node. Name:'/core/scorer/Reshape_1' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/tensor/reshape_helper.h:45 onnxruntime::ReshapeHelper::ReshapeHelper(const onnxruntime::TensorShape&, onnxruntime::TensorShapeVector&, bool) input_shape_size == size was false. The input tensor cannot be reshaped to the requested shape. Input shape:{1,0,1536}, requested shape:{1,1,1536,2,768}

Ani2019 avatar Oct 08 '25 13:10 Ani2019

Hello @Ani2019 ,

We improved ONNX conversion experience and fixed some bugs, feel free to follow this tutorial to convert this model and then use it.

https://github.com/urchade/GLiNER/blob/main/examples/convert_to_onnx.ipynb

Ingvarstep avatar Nov 27 '25 08:11 Ingvarstep