pytorch2onnx.py lite_hrnet error #859
Replies: 7 comments
-
@grimoire could you offer some tips? |
Beta Was this translation helpful? Give feedback.
-
Hi @zhepherd ONNX does not have perfect dynamic shape support for As a temporary solution, you can cast the pooling size to int. mini_size = [int(v) for v in mini_size]
out = [F.adaptive_avg_pool2d(s, mini_size) for s in x[:-1]] + [x[-1]] |
Beta Was this translation helpful? Give feedback.
-
thx for your help, i'll try~ BTW,why convert to int is ok? |
Beta Was this translation helpful? Give feedback.
-
Convert tensor (include shape tensor) to python integer will NOT be recorded in PyTorch->ONNX tracing. The value will be treated as a constant. |
Beta Was this translation helpful? Give feedback.
-
thx,i have convert to onnx succeed and results is the same,but onnx to mnn also succeed,but the result is wrong ,why? |
Beta Was this translation helpful? Give feedback.
-
Hi, I met the same error just like yours. I tried an other error occurs:
Any suggestion will be grateful. |
Beta Was this translation helpful? Give feedback.
-
For error: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions