Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] there is no "default" function in mod.so #17594

Open
wanggujin opened this issue Jan 15, 2025 · 0 comments
Open

[Help] there is no "default" function in mod.so #17594

wanggujin opened this issue Jan 15, 2025 · 0 comments
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@wanggujin
Copy link

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.

Image

then GetFunction("default") return a nullptr, the line gg=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 ?

@wanggujin wanggujin added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant