I have an isssue with a model that has a CropAndResize operator related to the processing of the boxes input. The error is as following:
Traceback (most recent call last):
File "tvm_eval_2nd_half.py", line 247, in <module>
mod, params = tvm_eval_non_tuned()
File "tvm_eval_2nd_half.py", line 75, in tvm_eval_non_tuned
shape=shape_dict)
File "/home/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", line 2441, in from_tensorflow
mod, params = g.from_tensorflow(graph, layout, shape, outputs)
File "/home/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", line 2085, in from_tensorflow
op = self._convert_operator(node.op, inputs, attr, graph)
File "/home/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", line 2404, in _convert_operator
sym = convert_map[op_name](inputs, attrs, self._params)
File "/home/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", line 504, in _impl
boxes = params.pop(inputs[1].name_hint).asnumpy().tolist()
File "/home/tvm/tvm/python/tvm/_ffi/_ctypes/node.py", line 75, in __getattr__
"'%s' object has no attribute '%s'" % (str(type(self)), name))
AttributeError: '<class 'tvm.relay.expr.Call'>' object has no attribute 'name_hint'
I have tried to add AtributteError to the except but still it does not work as I get the following error:
AssertionError: All inputs to infer must be available in params.
@yongwww@srkreddy1238 maybe you can comment on this since you added this operator recently
It seems that only in the inputs are constants it works. If the boxes input comes from a placeholder or another operator it fails while processing the crop_and_resize operator in the Tensorflow frontend.
I am currently debugging the Tensorflow frontend but any hint would be highly appreciated!
After having a look at the test_forward.py script and the generated Relay IR, I see that TVM generates one image.resize op for every box. In other words, the number of boxes must be known a compile time.
Is this right? If so, how to use it then in models where the number of boxes is not known or not constant?
@vinx13 Maybe you can also give me hint about this?
The only way that I was able to properly compile my model with CropAndResize was to remove the following assertion.
The test case located at test_forward.py works since all inputs given are constants. As soon as you use a Placeholder or another operator as input then you hit the error mentioned above.
The following is a minimal test model that also fails.