huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
134.86k stars 26.98k forks source link

Onnx validation got max absolute difference of: nan #34216

Open NakedEinstein opened 3 weeks ago

NakedEinstein commented 3 weeks ago

Hi i got this error when i am trying to convert huggingface bert-based torch model to onnx.

ValueError: Outputs values doesn't match between reference model and ONNX exported model: Got max absolute difference of: nan

The model i am trying to convert is training checkpoint model based on indobenchmark/indobert-large-p2.

Steps done

I already tried both feature versions AutoModel & AutoModelForSequenceClassification I already ensure file path(s) were correct

System info

onnx == 1.13.0 transformers[onnx] == 4.25.1 onnxruntime == 1.14.0 torch == 1.13.0

LysandreJik commented 3 weeks ago

Hey @NakedEinstein, could you share the entire code and stacktrace that you have? Thanks