TITAN/VisionTransformer ONNX Model giving error:"Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running MatMul node. Name:'/blocks/modules_list.0/attn/MatMul_1"
i converted the VisionTransformer model of TITAN to ONNX format by
"torch.onnx.export(model.vision_encoder,
example_inputs,
"titanVision_encoder.onnx",
input_names=['features', 'coords', 'patch_size_lv0'],
output_names=['output'],
traing=torch.onnx.TrainingMode.EVAL,
dynamic_axes={'features': {1:'sequence_length'},
'coords': {1: 'sequence_length'}},
opset_version=17, verbose=True,
do_constant_folding=False,
keep_initializers_as_inputs=True)" function.
then I load it by "session = onnxruntime.InferenceSession('titanVision_encoder.onnx')".when i run the session with the same input that I export it, the model returns the following error:"Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running MatMul node. Name:'/blocks/modules_list.0/attn/MatMul_1' Status Message: matmul_helper.h:162 onnxruntime::MatMulComputeHelper::Compute MatMul dimension mismatch"
Any guidance on how to resolve this error would be much appreciated. Thank you!