-
Notifications
You must be signed in to change notification settings - Fork 298
Open
Description
Describe the bug
handlers\backend\resize.py doesn't work handle tensors with unknown shapes well.
The fix in #1017 does not seem to be applicable here.
This is the error that I get:
ValueError: in user code:
File "c:\users\dirk\extrepos\onnx-tensorflow\onnx_tf\backend_tf_module.py", line 99, in __call__ *
output_ops = self.backend._onnx_node_to_tensorflow_op(onnx_node,
File "c:\users\dirk\extrepos\onnx-tensorflow\onnx_tf\backend.py", line 347, in _onnx_node_to_tensorflow_op *
return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
File "c:\users\dirk\extrepos\onnx-tensorflow\onnx_tf\handlers\handler.py", line 58, in handle *
cls.args_check(node, **kwargs)
File "c:\users\dirk\extrepos\onnx-tensorflow\onnx_tf\handlers\backend\resize.py", line 68, in args_check *
x_shape = x.get_shape().as_list()
ValueError: as_list() is not defined on an unknown TensorShape.
To Reproduce
Run this code with
import onnx
from onnx_tf.backend import prepare
onnx_model = onnx.load("model.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("model.pb")
Onnx model:
https://drive.google.com/file/d/1Tnl6X0k0IuWgJWNkx8AyqsDZH7pSF_1E/view?usp=sharing
Python, ONNX, ONNX-TF, Tensorflow version
- Python version: 3.10.11
- ONNX version: 1.14.1
- ONNX-TF version: 1.10.0
- Tensorflow version: 2.13.9
Additional context
The model is taken straight from:
torchvision.models.detection.faster_rcnn.fasterrcnn_resnet50_fpn
Metadata
Metadata
Assignees
Labels
No labels