Stream: git-wasmtime

Topic: wasmtime / issue #4464 Wasi-NN examples with misaligned l...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2022 at 15:14):

gusye1234 opened issue #4464:

First of all, thanks for the great implementation of Wasi-NN!
I found something misaligned while I tried to read the OpenVINO backend and the corresponding example.

In the example, we passed an image in form of a tensor with the shape (1, 3, 224, 224):
https://github.com/bytecodealliance/wasmtime/blob/3032e3fcfbb818dd567f85561fce7813f5979747/crates/wasi-nn/examples/classification-example/src/main.rs#L29-L33
However, in the OpenVINO backend, the layout of input is fixed to NHWC, which I believe means (Batch, Height, Width, Channel).
https://github.com/bytecodealliance/wasmtime/blob/3032e3fcfbb818dd567f85561fce7813f5979747/crates/wasi-nn/src/openvino.rs#L88

Does that mean the model will treat our input as an image with a height of 3 pixels, width of 224 pixels, and channel of 224 pixels? But why we can still get the correct prediction?


Last updated: Dec 23 2024 at 12:05 UTC