Leslie-Fang opened a new issue #5978:
URL: https://github.com/apache/incubator-tvm/issues/5978


   I am trying to convert a resnet style model into TVM, but I got the error 
message:
   ```
   Traceback (most recent call last):
     File "tensorflow_tvm.py", line 47, in <module>
       mod, params = relay.frontend.from_tensorflow(graph_def,
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 3574, in from_tensorflow
       mod, params = g.from_tensorflow(graph, layout, shape, outputs)
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 2967, in from_tensorflow
       func = self._get_relay_func(graph, layout=layout, shape=shape, 
outputs=outputs)
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 2926, in _get_relay_func
       self._backtrack_construct(node.name)
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 3508, in _backtrack_construct
       op = self._convert_operator(node.op, inputs, attr, self._graph)
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 3365, in _convert_operator
       sym = convert_map[op_name](inputs, attrs, self._params, self._mod)
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/tensorflow.py", 
line 1265, in _impl
       out = AttrCvt(op_name='batch_norm',
     File "/home/lesliefang/tvm/tvm/python/tvm/relay/frontend/common.py", line 
417, in __call__
       return get_relay_op(op_name)(*inputs, **new_attrs)
   TypeError: batch_norm() got an unexpected keyword argument 
'exponential_avg_factor'
   ```
   
   Refer to this issue https://github.com/apache/incubator-tvm/issues/3428, I 
have checked my model's bn op. it doesn't set this attr. But since this PR 
https://github.com/tensorflow/tensorflow/pull/37176, tensorflow should set the 
default value of this attr.
   
   I have 2 questions:
   1. It seems TVM will also check the op definition in Tensorflow's 
implementation, why not just check the user-defined attribution in the PB model.
   2. It's ok for me to just add the  
   ```
   self._ignores.append('exponential_avg_factor')
   ```
   here 
https://github.com/apache/incubator-tvm/blob/512ed3930a61daf38e80e1f71e51f0d1f139fb8e/python/tvm/relay/frontend/common.py#L367-L374
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to