shingjan opened a new issue, #11064:
URL: https://github.com/apache/tvm/issues/11064

   This issue below happens during importing onnx model in tvm with relay, 
`from_onnx` more specifically. The stack trace is as follows:
   
   ### Actual behavior
   
   ```
   "/home/yj/tvm/python/tvm/te/hybrid/parser.py", line 466, in <listcomp>
       args = [self.visit(i) for i in node.args]
     File "/home/yj/anaconda3/lib/python3.9/ast.py", line 407, in visit
       return visitor(node)
     File "/home/yj/tvm/python/tvm/te/hybrid/parser.py", line 379, in 
visit_Subscript
       for i in args:
   TypeError: 'IntImm' object is not iterable
   ```
   
   ### Expected behavior
   
   This model should be imported without an error under Python 3.9
   
   ### Environment
   
   TVM commit a94558686834c4ff7e4d90e4bc1fde5451ce445d
   
   Python 3.9
   
   ### Steps to reproduce
   
   ```
   import sys
   from os import path as osp
   import onnx
   import numpy as np
   import tvm
   from tvm import relay
   from tvm.meta_schedule.tune import tune_relay
   from tvm.target.target import Target
   
   
   if __name__ == "__main__":
       target = Target("llvm --num-cores=8")
   
       dev = tvm.cpu() if str(target.kind) == "llvm" else tvm.cuda()
       onnx_model = onnx.load(f"/home/yj/models/ssd.onnx")
       shape_dict = {}
       datas = {}
       input_shape = [1, 3, 1200, 1200]
       input_dtype = "float32"
       input_name = "image"
       shape_dict[input_name] = input_shape
       datas[input_name] = 
tvm.nd.array(np.random.randn(*input_shape).astype(input_dtype), dev)
       mod, params = relay.frontend.from_onnx(onnx_model, shape_dict, 
freeze_params=True)
   ```
   The model is `ssd.onnx` downloaded from OctoML's aquarium.
   
   cc: @areusch 
   


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