microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.65k stars 2.93k forks source link

Validate usage of dim_value (values should be > 0) and dim_param (all values with the same string should equate to the same size) in shapes in the model. #10148

Open joao-alves97 opened 2 years ago

joao-alves97 commented 2 years ago

I tried to replicate fastT5 for a different transformers model (EncoderDecoderModel) but I'm always facing this error:

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running MatMul node. Name:'MatMul_155' Status Message: /onnxruntime_src/onnxruntime/core/framework/op_kernel.cc:44 OrtValue* onnxruntime::OpKernelContext::OutputMLValue(int, const onnxruntime::TensorShape&, size_t) status.IsOK() was false. Shape mismatch attempting to re-use buffer. {1,1,768} != {1,133,768}. Validate usage of dim_value (values should be > 0) and dim_param (all values with the same string should equate to the same size) in shapes in the model.

environment: huggingface-hub 0.0.8 importlib-metadata 4.10.0 numpy 1.21.5 onnx 1.10.2 onnxruntime 1.4.0 packaging 21.3 pip 19.2.3 progress 1.6 protobuf 3.19.1 psutil 5.8.0 pyparsing 3.0.6 regex 2021.11.10 requests 2.26.0 sacremoses 0.0.46 sentencepiece 0.1.96 setuptools 41.2.0 six 1.16.0 tokenizers 0.10.3 torch 1.10.1 tqdm 4.62.3 transformers 4.4.2

Anyone having a similar error? Any idea on how to solve it? Thanks

yuslepukhin commented 2 years ago

Do you have a repro code and would you be able to share your model?

yuslepukhin commented 2 years ago

Also would you be able to try it out with the latest release?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.