intel / webml-polyfill

Deprecated, the Web Neural Network Polyfill project has been moved to https://github.com/webmachinelearning/webnn-polyfill
Apache License 2.0
161 stars 46 forks source link

Error happened when using WASM/WebGL backend of tfjs 2.0.1 to run Image Classification example. #1331

Open BruceDai opened 3 years ago

BruceDai commented 3 years ago

Error: The highest priority backend 'wasm' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods

@NALLEIN @akineeic please help investigate and fix it, thanks.

akineeic commented 3 years ago

The tfjs-backend-wasm module try to find simd binary when I specify a wasm file. I open an issue to upstream and this seems to an issue will be fixed in next release. This issue can be temporarily fixed by adding code as following to webpack the simd binary: import simdPath from '../../../node_modules/@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm-simd.wasm';

Or we can just back to the old version and wait for their new release.

huningxin commented 3 years ago

Thanks @akineeic , please send a PR to implement the workaround for current release. We can upgrade to the next release when it is available.

ibelem commented 3 years ago

@BruceDai please track the upstream bug status.

akineeic commented 3 years ago

I tried with the newest version(2.3.0) of tfjs-beckend-wasm but some errors still appeared. We need to wait for the next release as the developer said. Track with the upstream issue.

BruceDai commented 3 years ago

@akineeic Thanks for this information.