onnx2tf: [MMVC]Error occurs stating 'Resize operations other than 4D and 5D are not supported' for a 3D operation
Issue Type
Others
onnx2tf version number
1.8.10
onnx version number
1.13.1
tensorflow version number
2.12.0rc1
Download URL for ONNX
Parameter Replacement JSON
{}
Description
-
Purpose Product development
-
What I encountered an issue when trying to convert an ONNX file using onnx2tf. The error message I received is as follows:
$ onnx2tf -i make_sin_d.onnx -kat f0
INFO: onnx_op_type: Resize onnx_op_name: /Resize_1
INFO: input_name.1: /Where_3_output_0 shape: [1, 1, 42] dtype: float32
INFO: input_name.2: shape: None dtype: None
INFO: input_name.3: shape: None dtype: None
INFO: input_name.4: /Concat_8_output_0 shape: [3] dtype: <class 'numpy.int64'>
INFO: output_name.1: /Resize_1_output_0 shape: [1, 1, 5376] dtype: float32
ERROR: Currently, Resize operations other than 4D and 5D are not supported. Pull requests are welcome.
graph_node.name: /Resize_1 shape: (1, 1, 42)
ERROR: The trace log is below.
Traceback (most recent call last):
File "/home/stealth/anaconda3/envs/mmvc15/lib/python3.9/site-packages/onnx2tf/utils/common_functions.py", line 280, in print_wrapper_func
result = func(*args, **kwargs)
File "/home/stealth/anaconda3/envs/mmvc15/lib/python3.9/site-packages/onnx2tf/utils/common_functions.py", line 358, in inverted_operation_enable_disable_wrapper_func
result = func(*args, **kwargs)
File "/home/stealth/anaconda3/envs/mmvc15/lib/python3.9/site-packages/onnx2tf/utils/common_functions.py", line 49, in get_replacement_parameter_wrapper_func
func(*args, **kwargs)
File "/home/stealth/anaconda3/envs/mmvc15/lib/python3.9/site-packages/onnx2tf/ops/Resize.py", line 243, in make_node
sys.exit(1)
SystemExit: 1
ERROR: input_onnx_file_path: make_sin_d.onnx
ERROR: onnx_op_name: /Resize_1
- How I tried adding input parameter options to the test.
$ onnx2tf -i make_sin_d.onnx -ois f0:1,1,42 -cotof -cotoa 1e-1 -kat f0
I checked the vector size using Netron.
-
Why I would like to make these modifications because I want to run the model in TFLite.
-
Resources None
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 22 (11 by maintainers)
Resize
Resize
workaround for 1D tensorsThank you so much!! I tried converting the ONNX generated without modifying the torch-side model and confirmed that the conversion worked without any issues.
I see. So, the method of forcibly breaking the shape into 4D and resizing it seems to make sense.
Yes, thanks to PINTO-san’s advice, I was able to gain a better understanding of the differences between ONNX and TensorFlow. I then tried addressing the issue by modifying the torch-side model to be in the shape of (B, 1, 1, W).
With this change, I was able to confirm that the conversion using onnx2tf worked successfully.
It looks
asymmetric
x128, does this specification satisfy what you want to do?https://www.tensorflow.org/api_docs/python/tf/keras/layers/UpSampling1D
I understand what you are saying, but unfortunately it is impossible.
https://www.tensorflow.org/api_docs/python/tf/image/resize
Pseudo-scaling should be reimplemented using
TransposeConv
or similar.