leonwanghui opened Issue #1974:
Hi all, recently I'm working for compiling a pretrained model (ResNet50) into WASM bytecode, although the model has been transformed into WASM successfully, but it seems that there is no efficient way to pass the image data into WASM to perform inference. Here are some ways I have tried:
WASM Memory Type. Though it's efficient to save and load data, but it seems to have memory size limitation (
64KB
I guess), and when I load the Tensor of image (2MB+) into the memory type, the error occurred withthread 'main' panicked at 'wasm trap: undefined element: out of bounds table access wasm backtrace: 0: 0x41e4 - <unknown>!core::fmt::write::h4834d85ce1be7131 1: 0x2276c - <unknown>!<std::io::stdio::Stdout as std::io::Write>::write_fmt::hfcc1c9dfb39740ed 2: 0x22dcf - <unknown>!std::io::stdio::_print::hc41bda27e6084072 3: 0x34b86 - <unknown>!run ', src/main.rs:59:19 note: run with
RUST_BACKTRACE=1environment variable to display a backtrace
System interface. This way solves the problem of size limitation, but it would cause performance downgrade and be difficult to scale out.
Any thoughts on this? Thanks!
leonwanghui commented on Issue #1974:
It seems that the error would be gone when callling
memory.grow()
to grow up the memory size, so this PR would be closed.
leonwanghui closed Issue #1974:
Hi all, recently I'm working for compiling a pretrained model (ResNet50) into WASM bytecode, although the model has been transformed into WASM successfully, but it seems that there is no efficient way to pass the image data into WASM to perform inference. Here are some ways I have tried:
WASM Memory Type. Though it's efficient to save and load data, but it seems to have memory size limitation (
64KB
I guess), and when I load the Tensor of image (2MB+) into the memory type, the error occurred withthread 'main' panicked at 'wasm trap: undefined element: out of bounds table access wasm backtrace: 0: 0x41e4 - <unknown>!core::fmt::write::h4834d85ce1be7131 1: 0x2276c - <unknown>!<std::io::stdio::Stdout as std::io::Write>::write_fmt::hfcc1c9dfb39740ed 2: 0x22dcf - <unknown>!std::io::stdio::_print::hc41bda27e6084072 3: 0x34b86 - <unknown>!run ', src/main.rs:59:19 note: run with
RUST_BACKTRACE=1environment variable to display a backtrace
System interface. This way solves the problem of size limitation, but it would cause performance downgrade and be difficult to scale out.
Any thoughts on this? Thanks!
Last updated: Nov 22 2024 at 17:03 UTC