tfjs: WASM backend stopped working In the latest Chrome (macOS)

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js): No

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Big Sur version 11.3.1

  • TensorFlow.js installed from (npm or script link): CDN

  • TensorFlow.js version (use command below): 3.6.0

  • Browser version: Version 91.0.4472.77 (Official Build) (x86_64)

  • Tensorflow.js Converter Version: Did not use

Describe the current behavior Wasm backend stopped working after updating Chrome to the latest version

Describe the expected behavior It should work without errors

Standalone code to reproduce the issue https://jsfiddle.net/alex_oliynyk/2b6oa4dm/14/ (check the console)

Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

"Initialization of backend wasm failed"
"Error: Failed to construct 'Worker': Access to the script at 'blob:https://fiddle.jshell.net/eb0c5b29-6555-4ab3-9c45-38056d8e563a' is denied by the document's Content Security Policy.
    at Object.allocateUnusedWorker (https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4745:23103)
    at Object.initMainThreadBlock (https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4745:17789)
    at https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4745:47195
    at https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:5032:42
    at new Promise (<anonymous>)
    at https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4986:45
    at step (https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4662:25)
    at Object.next (https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4643:55)
    at fulfilled (https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.js:4633:60)"

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

sure, you can override what tfjs autodetected - just set this before calling setBackend('wasm'):

tf.ENV.set('WASM_HAS_SIMD_SUPPORT', false);
tf.ENV.set('WASM_HAS_MULTITHREAD_SUPPORT', false);