apivovarov opened a new pull request #4510: Fix TF resize for dynamic size 
models
URL: https://github.com/apache/incubator-tvm/pull/4510
 
 
   I have TF model with the following summary
   ```
   Found 1 possible inputs: (name=input, type=float(1), shape=[1,?,?,3]) 
   No variables spotted.
   Found 1 possible outputs: (name=Tanh, op=Tanh) 
   Found 2007162 (2.01M) const parameters, 0 (0) variable parameters, and 0 
control_edges
   Op types used: ..., 3 ResizeNearestNeighbor, ...
   ```
   
   The compilation gives me the following error
   ```
   oshape [None]
   Traceback (most recent call last):
   
     File "./compile_tensorflow.py", line 18, in <module>
       sym, params = relay.frontend.from_tensorflow(graph_def, layout='NCHW', 
shape=shape_dict)
   
     File 
"/usr/local/lib/python3.5/dist-packages/tvm-0.6.0-py3.5-linux-x86_64.egg/tvm/relay/frontend/tensorflow.py",
 line 2554, in from_tensorflow
       mod, params = g.from_tensorflow(graph, layout, shape, outputs)
   
     File 
"/usr/local/lib/python3.5/dist-packages/tvm-0.6.0-py3.5-linux-x86_64.egg/tvm/relay/frontend/tensorflow.py",
 line 2189, in from_tensorflow
       op = self._convert_operator(node.op, inputs, attr, graph)
   
     File 
"/usr/local/lib/python3.5/dist-packages/tvm-0.6.0-py3.5-linux-x86_64.egg/tvm/relay/frontend/tensorflow.py",
 line 2516, in _convert_operator
       sym = convert_map[op_name](inputs, attrs, self._params)
   
     File 
"/usr/local/lib/python3.5/dist-packages/tvm-0.6.0-py3.5-linux-x86_64.egg/tvm/relay/frontend/tensorflow.py",
 line 421, in _impl
       size = attr['_output_shapes'][0][1:3]
   
   TypeError: 'NoneType' object is not subscriptable
   ```
   
https://github.com/apache/incubator-tvm/blob/master/python/tvm/relay/frontend/tensorflow.py#L421
   
   The problem is that `attr['_output_shapes'][0]` is None. It means that the 
size is unknown and we need to infer what the shape should be (using 
`_infer_value`)

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to