FaceDetection is not working on wasm backend
See original GitHub issueHi everyone, first of all, thanks for this excellent library!
I ran into an issue while trying to run FaceDetection
or FaceLandmarksDetection
models on the wasm
backend.
Describe the current behavior
While this works well on WebGL
backend, when I use the wasm
backend, I get either empty array as a result or a memory access out of bounds
(might be related to #6128)
RuntimeError: memory access out of bounds
at tfjs-backend-wasm-simd.wasm:0x3ff23
at tfjs-backend-wasm-simd.wasm:0x2cdc7
at tfjs-backend-wasm-simd.wasm:0x2dacd
at tfjs-backend-wasm-simd.wasm:0x1d5d9
at tfjs-backend-wasm-simd.wasm:0x68da
at Module._FusedConv2D (tfjs-backend-wasm.js:9:21945)
at Object.fusedConv2d [as kernelFunc] (FusedConv2D.ts:140:3)
at kernelFunc (engine.ts:644:22)
at engine.ts:710:23
at Engine.scopedRun (engine.ts:478:19)
You can find code sandbox examples with WebGL
and wasm
below. I also tried this stock example provided by TensorFlow.js by adding tfjs-wasm
in the list of model backends, but I get the same issue with nothing detected at all (empty array)
Is there something I am missing or doing wrong here?
Thanks for your help!
Describe the expected behavior
I guess the expected behavior is that it works on both wasm
and WebGL
backend.
Standalone code to reproduce the issue
Example with wasm
backend: https://codesandbox.io/s/confident-nightingale-b8z48b
Example with WebGL
backend: https://codesandbox.io/s/elegant-tereshkova-mdqj6k
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): Yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS Monterey
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Pixel 4a
- TensorFlow.js installed from (npm or script link): npm
- TensorFlow.js version (use command below): 3.18.0
- Browser version: Chrome 102.0.5005.61
- Tensorflow.js Converter Version: 3.18.0
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Quick update to this issue: I built the WASM backend with debug flags set, and here’s its more descriptive error message. Thanks for posting a reproduction!
Are you satisfied with the resolution of your issue? Yes No