Open thekevinscott opened 5 months ago
./build-for-web.sh ndarray
appears to work, but introduces new errors into the console:
mnist_inference_web.js:315 panicked at /Users/thekevinscott/code/burn/burn-core/src/record/memory.rs:39:85:
called `Result::unwrap()` on an `Err` value: Utf8 { inner: Utf8Error { valid_up_to: 38, error_len: Some(1) } }
Stack:
Error
at imports.wbg.__wbg_new_abda76e883ba8a5f (http://localhost:8000/pkg/mnist_inference_web.js:299:21)
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[187]:0x4c6cb
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[237]:0x51717
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[206]:0x4d414
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[107]:0x39ce6
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[125]:0x477a5
at http://localhost:8000/pkg/mnist_inference_web_bg.wasm:wasm-function[265]:0x51bbb
at __wbg_adapter_18 (http://localhost:8000/pkg/mnist_inference_web.js:75:10)
at real (http://localhost:8000/pkg/mnist_inference_web.js:60:20)
Uncaught RuntimeError: unreachable
at mnist_inference_web_bg.wasm:0x4c7de
at mnist_inference_web_bg.wasm:0x51717
at mnist_inference_web_bg.wasm:0x4d414
at mnist_inference_web_bg.wasm:0x39ce6
at mnist_inference_web_bg.wasm:0x477a5
at mnist_inference_web_bg.wasm:0x51bbb
at __wbg_adapter_18 (mnist_inference_web.js:75:10)
at real (mnist_inference_web.js:60:20)
Uncaught Error: recursive use of an object detected which would lead to unsafe aliasing in rust
at imports.wbg.__wbindgen_throw (mnist_inference_web.js:321:15)
at mnist_inference_web_bg.wasm:0x5229a
at mnist_inference_web_bg.wasm:0x522b6
at mnist_inference_web_bg.wasm:0x4516a
at mnist_inference_web_bg.wasm:0x477a5
at mnist_inference_web_bg.wasm:0x51bbb
at __wbg_adapter_18 (mnist_inference_web.js:75:10)
at real (mnist_inference_web.js:60:20)
I saw the same thing with ndarray
, I was able to fix it by re-creating the model in the mnist example and copying model.bin to this example. Maybe something to do with the different cpu architecture the models are created on?
I cannot get wgpu
to work, but I see a different error, and also different errors in different browsers. I enabled the features for webgpu and webassembly in Chrome and Brave, but wondering if there are some non-obvious options that also need to be enabled.
error in chrome: panicked at 'called
Option::unwrap()on a
Nonevalue', /Users/eric/Downloads/burn/burn-wgpu/src/compute/base.rs:120
error in brave: panicked at 'An home directory should exist', burn-compute/src/tune/tune_cache.rs:25
The home directory definitely exists, so I don't know what is going on there, especially since the ndarray
example works. I tried enabling the Shared GPUImageDecodeCache
browser flag, along with rasterization, but still see the same error.
@ericcarmi Maybe we need to update the record. With the bin recorder, versions can be problematic. Testing with wgpu isn't trivial since not all platform support WebGPU.
We need to review to see if the model changed. If the model does not match the record, you'll have a mismatch. I propose we store a string representation of the record as part of the metadata.
Yeah, that was it. Retraining the model worked w/ ndarray backend
Unable to get the wgpu backend working on chrome following these steps: https://github.com/tensorflow/tfjs/issues/8065#issuecomment-1808785524
@ericcarmi Maybe we need to update the record. With the bin recorder, versions can be problematic. Testing with wgpu isn't trivial since not all platform support WebGPU.
Isn't a headless chrome + puppeter a solution? https://developer.chrome.com/blog/supercharge-web-ai-testing Seems like a good start.
Example doesn't compile currently, since the import location and signature of init_async
(for the Wgpu backend) changed
I created a PR to fix some issues with the wasm examples: #1824
Describe the bug The MNIST Inference web example is not working. It appears to be trying to load
pkg/mnist_inference_web.js
but no such file exists.To Reproduce
Expected behavior I expect the example to work.
Screenshots
Desktop (please complete the following information):