AttributeError: module 'tvm.relay.op.nn' has no attribute 'div'


#1

when I try to auto-tune the tensorflow inference from pb file, error occured in the stage of net, params = relay.frontend.from_tensorflow(graph_def, layout=layout, shape=shape_dict):
File /home/dolphin/.tvm_test_data/data/elephant-299.jpg exists, skip.
Tensorflow protobuf imported to relay frontend.
Extract tasks…
Traceback (most recent call last):
File “/home/dolphin/tvm/python/tvm/relay/frontend/tensorflow.py”, line 39, in _get_relay_op
op = getattr(_op, op_name)
AttributeError: module ‘tvm.relay.op’ has no attribute ‘div’

Traceback (most recent call last):
File “/home/dolphin/tvm/python/tvm/relay/frontend/tensorflow.py”, line 42, in _get_relay_op
op = getattr(_op.nn, op_name)
AttributeError: module ‘tvm.relay.op.nn’ has no attribute ‘div’


#2

what reason caused this error? and How to locate where this op is in the Graph? Thanks in advance!


#3

after putting the prints in the file of ~/tvm/python/tvm/relay/frontend/tensorflow.py, the result shows there is preprocess module before the input of inference module in the graph: preprocess/truediv_1 which contains div
elif node.op != “Placeholder”:
# Pass the parsed shapes instead
attr["_output_shapes"] = output_shapes = self._output_shapes[node.name]
print(‘show where the error’)
print(node.name)