Xilinx / Vitis-AI

Vitis AI is Xilinx’s development stack for AI inference on Xilinx hardware platforms, including both edge devices and Alveo cards.
https://www.xilinx.com/ai
Apache License 2.0
1.49k stars 634 forks source link

pyxir Error on inference with tvm, a tvm-model(*.so) is compiled via onnx-model #1029

Open teltim opened 2 years ago

teltim commented 2 years ago

Hi, relating to this issue: https://github.com/Xilinx/Vitis-AI/issues/721 I also would like to ask a similar quation. I made a "tvm_dpu_cpu.so" using onnx model: https://tvm.apache.org/docs/how_to/compile_models/from_onnx.html and prepared pyxir and tvm in Kria-kv260. But, when running inference, I encontered the same problem mentioned in the above link. Are there any way to escape from this problem? Best regards.

Traceback (most recent call last): File "/home/root/workspace/tvm-vai/test/run_mxnet_resnet_18.py", line 152, in run(file_path, shape_dict, iterations) File "/home/root/workspace/tvm-vai/test/run_mxnet_resnet_18.py", line 95, in run lib = tvm.runtime.load_module(file_path) File "/home/root/workspace/tvm-vai/tvm/python/tvm/runtime/module.py", line 613, in load_module return _ffi_api.ModuleLoadFromFile(path, fmt) File "tvm/_ffi/_cython/./packed_func.pxi", line 331, in tvm._ffi._cy3.core.PackedFuncBase.call File "tvm/_ffi/_cython/./packed_func.pxi", line 262, in tvm._ffi._cy3.core.FuncCall File "tvm/_ffi/_cython/./packed_func.pxi", line 251, in tvm._ffi._cy3.core.FuncCall3 File "tvm/_ffi/_cython/./base.pxi", line 181, in tvm._ffi._cy3.core.CHECK_CALL

KeyError: "KeyError: 'cpu-tf'\nAt:\n /home/root/workspace/venv01/lib/python3.9/site-packages/pyxir-0.3.5-py3.9-linux-aarch64.egg/pyxir/runtime/runtime_factory.py(60): build_runtime\n /home/root/workspace/venv01/lib/python3.9/site-packages/pyxir-0.3.5-py3.9-linux-aarch64.egg/pyxir/base.py(348): build\n /home/root/workspace/venv01/lib/python3.9/site-packages/pyxir-0.3.5-py3.9-linux-aarch64.egg/pyxir/base.py(498): build_online_quant_rt_opaque_func\n /home/root/workspace/venv01/lib/python3.9/site-packages/pyxir-0.3.5-py3.9-linux-aarch64.egg/pyxir/opaque_func.py(113): opaque_func_wrapper\n /home/root/workspace/tvm-vai/tvm/python/tvm/runtime/module.py(613): load_module\n /home/root/workspace/tvm-vai/test/run_mxnet_resnet_18.py(95): run\n /home/root/workspace/tvm-vai/test/run_mxnet_resnet_18.py(152): "

zkkli commented 1 year ago

H, has this problem been solved now?