cam145
June 14, 2020, 10:55am
1
New to this community and still try to learn more.
At the minute, I would like to use TVM to optimise a tensorflow model that uses some operators from tensorflow 2.2.
Use relay.frontend.from_tensorflow to import the model,
mod, params = relay.frontend.from_tensorflow(graph_def,
layout=layout,
shape=shape_dict)
I got the following information:
NotImplementedError: The following operators are not implemented: {'While', 'NonMaxSuppressionV5', 'TensorListStack', 'TensorListReserve'}
I noticed that there are NonMaxSuppressionV2 V3 operators. However, there is no implementation on ‘While’, ‘TensorListStack’, ‘TensorListReserve’.
I wonder if there is a plan to implement these operators. Or any advice on how to implement these operators.
Thanks in advance.
Current TF frontend parser is for tf 1.x. Community has some initial discussions about tf 2.x support but I’m not sure about the status.
cam145
June 15, 2020, 4:56pm
3
Hi Kevin,
Thanks for your reply.
I am trying to adapt the model to tf1, e.g., ‘NonMaxSuppressionV5’ in tf2 to ’ NonMaxSuppressionV3’, which is supported by tensorflow frontend.
The computational graph .pb file seems fine now.
However, when running
mod, params = relay.frontend.from_tensorflow(graph_def,
layout=layout,
shape=shape_dict)
still get three unsupported operators related to the pre-processing the input data.
NotImplementedError: The following operators are not implemented: {'TensorListStack', 'TensorListReserve', 'While'}
Thanks again.
Looks like some op names have changed across tf 1.x and 2.x.
1 Like
cam145
June 15, 2020, 8:30pm
5
Different operators:
[non_max_suppression/NonMaxSuppressionV3: NonMaxSuppressionV3] in tf1 that is supported by the current version of TVM. I looked into the source code of tensorflow frontend and there are two operators NMS, NonMaxSuppressionV2 and V3.
Look forward to seeing V5.
Hi Kevin,
After a bit break, I got back to the issues.
Now I got rid of the operators from the tensorflow side with no un-supported operators from tensorflow frontend.
However, I got the following issue:
57 except AttributeError:
58 raise AttributeError(
---> 59 "%s has no attribute %s" % (str(type(self)), name))
60
61 def __hash__(self):
AttributeError: <class 'tvm.relay.expr.Call'> has no attribute name_hint
This seems to be similar to this issue raised quite a while ago that mentioned you have fixed it.
https://github.com/apache/incubator-tvm/issues/4262
I pulled the latest version tvm. If you are interested, I can share the model file with you.
Thanks in advance.
@cam145 perhaps you could try to identify which op introduces the name_hint
AttributeError, then look into the details(like params, inputs, etc.) that node has.