[Help] there is no "default" function in mod.so #17594
Labels
needs-triage
PRs or issues that need to be investigated by maintainers to find the right assignees to address it
type: bug
envrionment:
llvm-project: release/19.x (build from source)
tvm: v0.18.0 (build from source)
python: 3.10.12
wsl: ubuntu22.04
I compiled a model through below command:
python3 -m tvm.driver.tvmc compile --target "llvm" --input-shapes "input:[1,3,224,224]" --output resnet50.tar --model-format "onnx" resnet50.onnx
but, no default function in the mod.so generated.
then
GetFunction("default")
return a nullptr, the linegg=de(dev)
crashed.i also tried add
--model-name "default"
in the compile command, but it's useless.But, if i use python script like below,the mod.so generated is fine and the inference through c++ is fine too.
`import onnx
import tvm
import tvm.relay as relay
onnx_model = onnx.load("/tmp/resnet50.onnx")
input_name = "input"
shape_dict = {input_name: [1,3,224,224]}
mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
target = tvm.target.Target("llvm")
with relay.build_config(opt_level=3):
module = relay.build(mod, target=target, params=params)
module.export_library("mod.so")`
I don't know what's the difference, can anyone help ?
The text was updated successfully, but these errors were encountered: