[Tensorflow][frontend]Support for tensor frontend new operators

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.

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

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. :wink:

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.

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.