import onnx
from onnx_tf.backend import prepare
import numpy as np
from PIL import Image
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "5"
model = onnx.load('super_resolution.onnx')
tf_rep = prepare(model)
Traceback (most recent call last):
File "RDAR_onnx_tf.py", line 13, in <module>
tf_rep = prepare(model)
File "/root/github/onnx-tensorflow/onnx_tf/backend.py", line 76, in prepare
return cls.onnx_model_to_tensorflow_rep(model, strict)
File "/root/github/onnx-tensorflow/onnx_tf/backend.py", line 87, in onnx_model_to_tensorflow_rep
return cls._onnx_graph_to_tensorflow_rep(model.graph, model.opset_import, strict)
File "/root/github/onnx-tensorflow/onnx_tf/backend.py", line 141, in _onnx_graph_to_tensorflow_rep
onnx_node, tensor_dict, handlers, opset=opset, strict=strict)
File "/root/github/onnx-tensorflow/onnx_tf/backend.py", line 236, in _onnx_node_to_tensorflow_op
return handler.handle(node, tensor_dict=tensor_dict, strict=strict)
File "/root/github/onnx-tensorflow/onnx_tf/handlers/handler.py", line 59, in handle
return ver_handle(node, **kwargs)
File "/root/github/onnx-tensorflow/onnx_tf/handlers/backend/add.py", line 23, in version_7
return [cls.make_tensor_from_onnx_node(node, **kwargs)]
File "/root/github/onnx-tensorflow/onnx_tf/handlers/backend_handler.py", line 111, in make_tensor_from_onnx_node
return cls._run_tf_func(tf_func, inputs, attrs)
File "/root/github/onnx-tensorflow/onnx_tf/handlers/backend_handler.py", line 180, in _run_tf_func
**dict([(p, attrs[p]) for p in params if p in attrs]))
File "/root/anaconda3/envs/onnx_tf18_py36/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 297, in add
"Add", x=x, y=y, name=name)
File "/root/anaconda3/envs/onnx_tf18_py36/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/anaconda3/envs/onnx_tf18_py36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/anaconda3/envs/onnx_tf18_py36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1734, in __init__
control_input_ops)
File "/root/anaconda3/envs/onnx_tf18_py36/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1570, in _create_c_op
raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 224 and 64 for 'Add' (op: 'Add') with input shapes: [1,64,224,224], [64].
environment
ubuntu 16.04
tensorflow-gpu 1.8.0
onnx 1.2.2
onnx-tf 1.1.2
The log:
The onnx model is downloaded from this link:
[https://s3.amazonaws.com/onnx-mxnet/examples/super_resolution.onnx]