hope51607 opened a new pull request, #11507:
URL: https://github.com/apache/tvm/pull/11507

   When I run the onnx version mobilenet_v1 from 
[here](https://zenodo.org/record/3157894) without freeze_params, I meet an 
error:
   ```
   tvm/python/tvm/relay/frontend/onnx.py:6006: in _convert_operator
       sym = convert_map[op_name](inputs, attrs, self._params)
   tvm/python/tvm/relay/frontend/onnx.py:2426: in _impl_v1
       data_reshape = _op.reshape(inputs[0], newshape=reshape_shape)
   
   ...
   
           if isinstance(newshape, (tuple, list)):
               tempshape = []
               print("newshape: ", newshape)
               for shape in newshape:
                   if isinstance(shape, _expr.IntImm):
                       tempshape.append(shape.value)
                   else:
                       try:
                           print("shape: ", shape)
   >                       tempshape.append(int(shape))
   E                       TypeError: int() argument must be a string, a 
bytes-like object or a number, not 'Any'
   tvm/python/tvm/relay/op/transform.py:311: TypeError
   ```
   
   This is caused by Softmax encountering an input with a dynamic shape and 
using it to construct reshape.
   I think simple solution is to directly create Softmax when axis==-1.
   I also rewrite the Softmax test to cover dynamic case.
   
   @blackkker @AndrewZhaoLuo @mbrookhart please give it a look. 
   
   Thanks for contributing to TVM!   Please refer to guideline 
https://tvm.apache.org/docs/contribute/ for useful information and tips. After 
the pull request is submitted, please request code reviews from 
[Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers)
 by @ them in the pull request thread.
   


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to