You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Onnx checker failed for "bertsquad_mha_layernorm.onnx" model
with the following error "onnx.onnx_cpp2py_export.checker.ValidationError: Nodes in a graph must be topologically sorted, however input 'bert/encoder/Reshape__27:0' of node:
name: bert/encoder/Reshape OpType: Reshape"
Steps to reproduce:
1 Run bert_mha_layernorm_fuse() function in benchmark/examples.py with bertsquad-12.onnx model
2 It will output bertsquad_mha_layernorm.onnx model
3 Load the model and check with onnx checker
Code to reproduce :
onnx_model=onnx.load(' bertsquad_mha_layernorm.onnx')
onnx.checker.check_model(onnx_model)
Can you please let me know how to solve this error?
The text was updated successfully, but these errors were encountered:
Hi, what's your purpose for performing a check_model? The fused graph has custom-defined operators like layernorm and MHA. It won't pass this check anyway. Nodes in a graph must be topologically sorted this can be done by g.graph_reorder_nodes()
"onnx.onnx_cpp2py_export.checker.ValidationError: Nodes in a graph must be topologically sorted, however input 'bert/encoder/Reshape__27:0' of node:
name: bert/encoder/Reshape OpType: Reshape"
Steps to reproduce:
1 Run bert_mha_layernorm_fuse() function in benchmark/examples.py with bertsquad-12.onnx model
2 It will output bertsquad_mha_layernorm.onnx model
3 Load the model and check with onnx checker
Code to reproduce :
onnx_model=onnx.load(' bertsquad_mha_layernorm.onnx')
onnx.checker.check_model(onnx_model)
Can you please let me know how to solve this error?
The text was updated successfully, but these errors were encountered: