AxisCommunications / onnx-to-keras

Convert onnx models exported from pytorch to tensorflow keras models with focus on performace and highleve compatibility.
MIT License
25 stars 13 forks source link

transpose layer not supported ? #47

Open Dumbledore38 opened 1 year ago

Dumbledore38 commented 1 year ago

Describe the bug

Explain the behavior you would expect and the actual behavior.

To reproduce

Use model from and generate the .onnx file

Screenshots

python .\onnx-to-keras-master\onnx2keras.py .\FastestDet.onnx onnx2keras.py:52: OptimizationMissingWarning: Transpose inserted. Please report at https://github.com/AxisCommunications/onnx-to-keras/issues warnings.warn("Transpose inserted. Please report at https://github.com/AxisCommunications/onnx-to-keras/issues", OptimizationMissingWarning) Traceback (most recent call last): File "S:\projects\tiny_dazhi\sys_arch\NN_analysis\src\FastestDet-main\FastestDet-main\onnx-to-keras-master\onnx2keras.py", line 770, in Fire(main) File "C:\Python39\lib\site-packages\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "C:\Python39\lib\site-packages\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( File "C:\Python39\lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, *kwargs) File "S:\projects\tiny_dazhi\sys_arch\NN_analysis\src\FastestDet-main\FastestDet-main\onnx-to-keras-master\onnx2keras.py", line 758, in main model = onnx2keras(onnx.load(infile), make_tflite_compatible) File "S:\projects\tiny_dazhi\sys_arch\NN_analysis\src\FastestDet-main\FastestDet-main\onnx-to-keras-master\onnx2keras.py", line 699, in onnx2keras output_tensors = ops.make_op(node.op_type, inputs, attrs) File "S:\projects\tiny_dazhi\sys_arch\NN_analysis\src\FastestDet-main\FastestDet-main\onnx-to-keras-master\onnx2keras.py", line 18, in makeop return getattr(self, 'op' + op_type.lower())(inputs, **attrs) File "S:\projects\tiny_dazhi\sys_arch\NN_analysis\src\FastestDet-main\FastestDet-main\onnx-to-keras-master\onnx2keras.py", line 620, in op_reshape assert x.shape[0] == shape[0] or shape[0] == -1 AssertionError

If applicable, add screenshots to help explain your problem.

Environment

Additional context