Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaxPool3D not supported #1018

Closed
ralovich opened this issue Jul 23, 2020 · 2 comments · Fixed by #1020
Closed

MaxPool3D not supported #1018

ralovich opened this issue Jul 23, 2020 · 2 comments · Fixed by #1020

Comments

@ralovich
Copy link

Describe the bug
MaxPool3D layers not supported

Urgency
If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubunut 20.04
  • Tensorflow Version: 2.2
  • Python version: 3.8

To Reproduce
Reproducer network available at https://github.com/ralovich/trt-regression
$python -m tf2onnx.convert --input model_100.pb --inputs input_1_100_100_100_1:0 --outputs inception_v3_3d_1/output/sub_1:0 --output model_100.onnx --opset 12

Expected behavior
Also 3d pooling (AvgPool3D and MaxPool3D) layers are converted.

Screenshots
INFO:tensorflow:Froze 0 variables.
2020-07-23 18:47:46,076 - INFO - Froze 0 variables.
INFO:tensorflow:Converted 0 variables to const ops.
2020-07-23 18:47:46,080 - INFO - Converted 0 variables to const ops.
2020-07-23 18:47:46,554 - INFO - Using tensorflow=2.2.0, onnx=1.7.0, tf2onnx=1.7.0/38b1a6
2020-07-23 18:47:46,554 - INFO - Using opset <onnx, 12>
2020-07-23 18:47:47,219 - ERROR - Tensorflow op [inception_v3_3d_1/full_conv/pool2: MaxPool3D] is not supported
2020-07-23 18:47:47,252 - ERROR - Unsupported ops: Counter({'MaxPool3D': 1})
2020-07-23 18:47:47,257 - INFO - Optimizing ONNX model
2020-07-23 18:47:47,334 - WARNING - Failed to apply remove_back_to_back
Traceback (most recent call last):
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/init.py", line 52, in optimize_graph
graph = opt.optimize(current) or graph
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/optimizer_base.py", line 41, in optimize
graph = self._optimize(graph)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 35, in _optimize
return self._apply_optimization(graph, self._optimize_at_current_graph_level)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/optimizer_base.py", line 62, in _apply_optimization
graph = optimize_func(graph)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 67, in _optimize_at_current_graph_level
q2 = handler(g, node, consumer_nodes)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 134, in _optimize_transpose
new_perm = [t1[i] for i in t2]
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 134, in
new_perm = [t1[i] for i in t2]
IndexError: list index out of range
2020-07-23 18:47:47,391 - WARNING - Failed to apply remove_back_to_back
Traceback (most recent call last):
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/init.py", line 52, in optimize_graph
graph = opt.optimize(current) or graph
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/optimizer_base.py", line 41, in optimize
graph = self._optimize(graph)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 35, in _optimize
return self._apply_optimization(graph, self._optimize_at_current_graph_level)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/optimizer_base.py", line 62, in _apply_optimization
graph = optimize_func(graph)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 67, in _optimize_at_current_graph_level
q2 = handler(g, node, consumer_nodes)
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 134, in _optimize_transpose
new_perm = [t1[i] for i in t2]
File "/home/tade/venv-tf-2.2/lib/python3.8/site-packages/tf2onnx/optimizer/back_to_back_optimizer.py", line 134, in
new_perm = [t1[i] for i in t2]
IndexError: list index out of range
2020-07-23 18:47:47,393 - INFO - After optimization: Const -22 (63->41), Identity -1 (1->0), Transpose -4 (38->34)
2020-07-23 18:47:47,398 - INFO -
2020-07-23 18:47:47,398 - INFO - Successfully converted TensorFlow model model_100.pb to ONNX
2020-07-23 18:47:47,404 - INFO - ONNX model is saved at model_100.onnx

Additional context
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.

@ralovich
Copy link
Author

Maybe the network in the above reproducer (https://github.com/ralovich/trt-regression) could be used to build a test-case for this?

@TomWildenhain-Microsoft
Copy link
Contributor

Working on it with #1020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants