tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] Can the virtual machine executor support inference on dynamic shape of OCR model?

Open lijiannan1241 opened this issue 3 years ago • 4 comments
trafficstars

Hi, I observe that tvm only support transform on Oneflow or Onnx dynamic shape model. I have tried to tranform so many OCR Onnx models to relay but all failed because the presence of this operator I guess. Fortunately, I succeed to tranform a Onnx model named “ch_PP-OCRv3_rec_infer”, which can be converted from the Paddle model via the paddle2onnx tool. (url: https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.5/doc/doc_ch/ppocr_introduction.md) 
Then, I load this model to create a virtual machine executor by using the relay.build_module.create_executor func. But, there still exists a problem called “RuntimeError : Invalid type of axis: <class ‘tvm.tir.expr.add’>”, as shown below.

image Um … I search this problem on Google and TVM Discuss, and find a same problem without any solutions. image Is it the conv2d operator problem ? or the virtual machine executor are not friendly to the dynamic shape tensor?

lijiannan1241 avatar Aug 04 '22 04:08 lijiannan1241

I am also confused by the TVM dynamic Shape problem. Can anyone provide some information?

JingliangGao avatar Aug 04 '22 06:08 JingliangGao

Can you post your reproducible script? An error message alone is not helpful for debugging.

masahi avatar Aug 04 '22 07:08 masahi

Hi mashi @masahi , @cdljn2011 is one of my friends and we can provide the code and data for you, which can be downloaded from the Google Drive or Baidu Disk as follows. We build and run it in 0.10.0 TVM with clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.

Google Drive —— https://drive.google.com/file/d/1L2_O7zZ4O7aicHHrksMG7d50HzvdoEao/view?usp=sharing Baidu Disk —— url:https://pan.baidu.com/s/1ua52_lB3vu180d9dxn6gOA password:FT12

JingliangGao avatar Aug 05 '22 08:08 JingliangGao

Hi @tqchen @AndrewZhaoLuo , can you provide some valuable information?

JingliangGao avatar Aug 09 '22 00:08 JingliangGao

Please use the forum for general usage questions. https://discuss.tvm.apache.org/

masahi avatar Dec 08 '22 09:12 masahi

@JingliangGao Did you solve this question? I alse meet this problem, it seems the matrix dimensions is limited ? any one can help ?

sanersbug avatar Dec 10 '22 13:12 sanersbug