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 987410 via Apache TVM Discuss <no...@discuss.tvm.ai> on 2021/11/15 03:24:33 UTC

[Apache TVM Discuss] [Questions] TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'


Hi, when I import ssd resnet34 into tvm (latest version), got the error below:  

TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'

ERROR occurred in python/tvm/relay/fronted/tensorflow_ops.py:

def _stridedSlice()
...
...
ret = _op.reshape(out, newshape=tuple(final_output))

Questions are:
does this error means tvm cannot support dynamic stridedSlice operator right now?
whether tvm can run ssdresnet34 tensorflow model now?   

thanks





---
[Visit Topic](https://discuss.tvm.apache.org/t/typeerror-int-argument-must-be-a-string-a-bytes-like-object-or-a-number-not-any/11468/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/e8878ec3dfaa04f77dfc14193c59c73394de3b2c4aad9ebecc8ce1b4ce238aa9).

[Apache TVM Discuss] [Questions] TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'

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

Hi, thanks for your reply. 

the tensorflow model is from https://zenodo.org/record/3345892/files/tf_ssd_resnet34_22.1.zip?download=1
 in page : https://github.com/mlcommons/inference/tree/master/vision/classification_and_detection

actually, the script is simple like below:

    with tf.gfile.FastGFile(model_path, 'rb') as f:
                graph_def = tf.compat.v1.GraphDef()
                graph_def.ParseFromString(f.read())
                graph = tf.import_graph_def(graph_def, name='')
                graph_def = tf_testing.ProcessGraphDefParam(graph_def)
                with tf.Session() as sess:
                    graph_def = tf_testing.AddShapesToGraphDef(sess, output_name)
        
            mod, params = relay.frontend.from_tensorflow(graph_def, layout=layout, shape={input_name[0]:(relay.Any(), 3, 1200, 1200)})





---
[Visit Topic](https://discuss.tvm.apache.org/t/typeerror-int-argument-must-be-a-string-a-bytes-like-object-or-a-number-not-any/11468/6) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/8854dfbb407ae9ea89ff80d03eadfcb2caa5a7f48644f4288bbb78f061541af1).

[Apache TVM Discuss] [Questions] TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'

Posted by Andrew Zhao Luo via Apache TVM Discuss <no...@discuss.tvm.ai>.

If you give me the script you are running and model I can help out.

This is likely due to reshape not supporting dynamic shape but there are probably several workarounds.





---
[Visit Topic](https://discuss.tvm.apache.org/t/typeerror-int-argument-must-be-a-string-a-bytes-like-object-or-a-number-not-any/11468/5) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/e0d20b4cad2a88ae1c66612416b4ec22875bd7b60d28973e22272fc960c1d793).

[Apache TVM Discuss] [Questions] TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'

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

    Traceback (most recent call last):
      File "./lxch_test_tf_onnx__mlperf_ssdresnet34.py", line 361, in <module>
        enable_xtcl_save_so, enable_xtcl_load_so, lib_file, json_file, params_file)
      File "./lxch_test_tf_onnx__mlperf_ssdresnet34.py", line 137, in xtcl_run
        mod, params = relay.frontend.from_tensorflow(graph_def, layout=layout, shape={input_name[0]:(relay.Any(), 3, 1200, 1200)})
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1263, in from_tensorflow
        mod, params = g.from_tensorflow(graph, layout, shape, outputs)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 659, in from_tensorflow
        func = self._get_relay_func(graph, layout=layout, shape=shape, outputs=outputs)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 619, in _get_relay_func
        self._backtrack_construct(node.name)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1130, in _backtrack_construct
        node, [], attr, self._control_flow_node_map
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 865, in _convert_control_flow_operator
        op = self._licm_construct(plname, node.input[0])
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1068, in _licm_construct
        actual_expr = self._backtrack_construct(node_name)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1160, in _backtrack_construct
        converted = self._backtrack_construct(name)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in _backtrack_construct
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1137, in <listcomp>
        inputs = [self._backtrack_construct(iname) for iname in node.input]
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1182, in _backtrack_construct
        op = self._convert_operator(node.op, node.name, inputs, attr)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow.py", line 1025, in _convert_operator
        sym = convert_map[op_name](inputs, attrs, self._params, self._mod)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/frontend/tensorflow_ops.py", line 2290, in _impl
        print(attr)
      File "/workspace/1104-mlperf/tvm-official/tvm/python/tvm/relay/op/transform.py", line 245, in reshape
        tempshape.append(int(shape))
    TypeError: int() argument must be a string, a bytes-like object or a number, not 'Any'





---
[Visit Topic](https://discuss.tvm.apache.org/t/typeerror-int-argument-must-be-a-string-a-bytes-like-object-or-a-number-not-any/11468/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/b5410366a28bf8b4b58f9190508838139ae6b6e46de1360c8fda73051510318a).