Skip to content

Vm.run_func() FuncTypeMismatch using wasmedge_bindgen #2829

Closed Answered by apepkuss
KeeganJin asked this question in Q&A
Discussion options

You must be logged in to vote

As your code shows, you register module as a named module. It is named "extern". However, you invoke the call_infer from an active module that does not exist.

Fix: replace .register_module(Some("extern"), module)?; with .register_module(None, module)?;, then try again.

...

#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
fn infer() -> Result<(), Box<dyn std::error::Error>> {

    ...

    // load wasm module from file
    let module = Module::from_file(Some(&config), wasm_file)?;

   // build a Vm
    let mut vm = VmBuilder::new()
        .with_config(config)
        .with_plugin_wasi_nn()
        .build()?
        .register_module(Some("extern"), module)?;   <=========== registe…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@KeeganJin
Comment options

Comment options

You must be logged in to vote
1 reply
@KeeganJin
Comment options

Comment options

You must be logged in to vote
2 replies
@KeeganJin
Comment options

@apepkuss
Comment options

Answer selected by KeeganJin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants