You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by wwwwcu via TVM Discuss <no...@discuss.tvm.ai> on 2020/06/16 06:34:25 UTC

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow


Hi,

When I import SSD-Resnet34 (it is downloaded from https://github.com/mlperf/inference/tree/master/v0.5/classification_and_detection, ssd-resnet34 1200x1200 Tensorflow model)
```
import tvm
from tvm import relay
import tensorflow as tf
from tvm.relay.frontend.tensorflow_parser import TFParser
import tvm.relay.testing.tf as tf_testing

target = 'llvm'
target_host = 'llvm'
layout = None
ctx = tvm.cpu(0)

# mlperf model
model_path = './tf_ssd_resnet34_22.1/resnet34_tf.22.1.pb'

parser = TFParser(model_path)
graph_def = parser.parse()

with tf.gfile.GFile(model_path, 'rb') as f:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(f.read())
    graph = tf.import_graph_def(graph_def, name='')
    graph_def = tf_testing.ProcessGraphDefParam(graph_def)

mod, params = relay.frontend.from_tensorflow(graph_def, layout=layout)
```

The following error occurred:
```
AttributeError: <class 'tvm.relay.expr.Call'> has no attribute name_hint
```
I'm not sure what exactly the error is.





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/cdfa3cb6a48124dfcc0bcb1c37b4aff8bcc30b5cf3062291652a895b054da2f3).

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow

Posted by wwwwcu via TVM Discuss <no...@discuss.tvm.ai>.

I tried ```padlist = _infer_value(inputs[1], params, mod).asnumpy()```, and the error is fixed. Thanks!





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/5) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/7b5412f8161acd4f3fd7da3d194ed8e6d3c681bc92a13f439293af86e442b3e2).

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow

Posted by Yao Wang via TVM Discuss <no...@discuss.tvm.ai>.

This means padlist is actually symbolic. You can try something like ```padlist = _infer_value(inputs[1], params, mod)``` to see whether it can be pre-computed.





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/402609d0323c9dfd5ef1436f4ab35f7fb1e68ef2120bec16ed2ff10b4fd58101).

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow

Posted by wwwwcu via TVM Discuss <no...@discuss.tvm.ai>.

Thanks for your quick reply.
```
WARNING:root:Attribute _node_name is ignored in relay.sym.take
WARNING:root:Attribute _target_layout is ignored in relay.sym.take
WARNING:root:Attribute Tdim is ignored in relay.sym.expand_dims
WARNING:root:Attribute T is ignored in relay.sym.expand_dims
WARNING:root:Attribute _output_shapes is ignored in relay.sym.expand_dims
WARNING:root:Attribute _node_name is ignored in relay.sym.expand_dims
WARNING:root:Attribute _target_layout is ignored in relay.sym.expand_dims
Traceback (most recent call last):
  File "/home/incubator-tvm-0612/python/tvm/runtime/object.py", line 55, in __getattr__
    return _ffi_node_api.NodeGetAttr(self, name)
  File "/home/incubator-tvm-0612/python/tvm/_ffi/_ctypes/packed_func.py", line 225, in __call__
    raise get_last_ffi_error()
AttributeError: Traceback (most recent call last):
  [bt] (4) /home/incubator-tvm-0612/build/libtvm.so(TVMFuncCall+0x65) [0x7f8dd4304985]
  [bt] (3) /home/incubator-tvm-0612/build/libtvm.so(std::_Function_handler<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*), void (*)(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)>::_M_invoke(std::_Any_data const&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&)+0x14) [0x7f8dd39ed874]
  [bt] (2) /home/incubator-tvm-0612/build/libtvm.so(tvm::NodeGetAttr(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)+0x146) [0x7f8dd39ed746]
  [bt] (1) /home/incubator-tvm-0612/build/libtvm.so(tvm::ReflectionVTable::GetAttr(tvm::runtime::Object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const+0x24a) [0x7f8dd39ed17a]
  [bt] (0) /home/incubator-tvm-0612/build/libtvm.so(+0xc7ce8b) [0x7f8dd39e9e8b]
  File "/home/incubator-tvm-0612/src/node/reflection.cc", line 110
AttributeError: relay.Call object has no attributed name_hint

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/incubator-tvm-0612/tutorials/test_tensorflow/ssd_resnet_34.py", line 32, in <module>
    mod, params = relay.frontend.from_tensorflow(graph_def, layout='NHWC', shape=(1, 1200, 1200, 3))
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3587, in from_tensorflow
    mod, params = g.from_tensorflow(graph, layout, shape, outputs)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 2980, in from_tensorflow
    func = self._get_relay_func(graph, layout=layout, shape=shape, outputs=outputs)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 2935, in _get_relay_func
    self._backtrack_construct(node.name)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3475, in _backtrack_construct
    self._control_flow_node_map)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3222, in _convert_control_flow_operator
    op = self._licm_construct(plname, node.input[0])
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3410, in _licm_construct
    actual_expr = self._backtrack_construct(node_name)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3499, in _backtrack_construct
    converted = self._backtrack_construct(shape_node.name)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in _backtrack_construct
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in <listcomp>
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in _backtrack_construct
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in <listcomp>
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in _backtrack_construct
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in <listcomp>
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in _backtrack_construct
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3481, in <listcomp>
    inputs = [self._backtrack_construct(iname) for iname in node.input]
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3521, in _backtrack_construct
    op = self._convert_operator(node.op, inputs, attr, self._graph)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 3378, in _convert_operator
    sym = convert_map[op_name](inputs, attrs, self._params, self._mod)
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 1571, in _impl
    padlist = _get_param(params, inputs[1])
  File "/home/incubator-tvm-0612/python/tvm/relay/frontend/tensorflow.py", line 90, in _get_param
    return params[input_node.name_hint].asnumpy()
  File "/home/incubator-tvm-0612/python/tvm/runtime/object.py", line 58, in __getattr__
    "%s has no attribute %s" % (str(type(self)), name))
AttributeError: <class 'tvm.relay.expr.Call'> has no attribute name_hint

Process finished with exit code 1
```
FYI.





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/2946c537ec40cc1a1f460efe570e6ef1bfc41bc8916f6b5628ac8a5505cd0f32).

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow

Posted by Yao Wang via TVM Discuss <no...@discuss.tvm.ai>.

Can you print full trace?





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/40f4b7d9f849f344a43a75ed59e8170ed129cf3ce1c73cf96eca8df9583b4988).

[TVM Discuss] [Questions] has no attribute name_hint when importing SSD-ResNet34 from TensorFlow

Posted by Yao Wang via TVM Discuss <no...@discuss.tvm.ai>.

@wwwwcu Would you mind file a patch for this?





---
[Visit Topic](https://discuss.tvm.ai/t/class-tvm-relay-expr-call-has-no-attribute-name-hint-when-importing-ssd-resnet34-from-tensorflow/6989/6) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/d93486b121a02ec3fd6d5168fa746426ba830a7f85413c263f4d99bf4589e149).