Error in loading ONNX model with ONNXRuntime
I'm converting a customized Pytorch model to ONNX. However, when loading it with ONNXRuntime, I've encountered an error as follows:
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: ...onnxruntime/core/providers/cpu/tensor/transpose.h:46 onnxruntime::TransposeBase::TransposeBase(const onnxruntime::OpKernelInfo &amp;) v &gt;= 0 &amp;&amp; static_cast&lt;uint64_t&gt;(v) &lt;= std::numeric_limits&lt;size_t&gt;::max() was false.


I've checked with onnx.checker.check_model() and it's totally fine.
I've also tried to replace transpose() into permute() in forward() function but the error has still remained.
Is anyone familiar with this error?
Environments:
Python 3.7
Pytorch 1.9.0
CUDA 10.2 
ONNX 1.10.1
ONNXRuntime 1.8.1 
OS Ubuntu 18.04



The perm attribute of node Transpose_52 is [-1, 0, 1] although ONNX Runtime requires that all of them should be positive: onnxruntime/core/providers/cpu/tensor/transpose.h#L46
