tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.36k stars 1.92k forks source link

[wasm]Error: Kernel 'Complex' not registered for backend 'wasm' #5440

Open axinging opened 3 years ago

axinging commented 3 years ago

Case:

 it('complex', async () => {
    const real = tf.tensor1d([3, 30]);
    const imag = tf.tensor1d([4, 40]);
    const complex = tf.complex(real, imag);
    const res = tf.mul(complex, complex);
    expectArraysClose(await res.data(), [-7, 24, -700, 2400]);
  });

Error:

Step #23 - "test-wasm-tfjs-backend-wasm":   Message:
Step #23 - "test-wasm-tfjs-backend-wasm":     Error: Kernel 'Complex' not registered for backend 'wasm'
Step #23 - "test-wasm-tfjs-backend-wasm":   Stack:
Step #23 - "test-wasm-tfjs-backend-wasm":     Error: Kernel 'Complex' not registered for backend 'wasm'
Step #23 - "test-wasm-tfjs-backend-wasm":         at Engine.runKernel (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/engine.js:521:23)
Step #23 - "test-wasm-tfjs-backend-wasm":         at complex_ (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/complex.js:59:32)
Step #23 - "test-wasm-tfjs-backend-wasm":         at Object.complex__op [as complex] (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/operation.js:79:33)
Step #23 - "test-wasm-tfjs-backend-wasm":         at /workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:125:38
Step #23 - "test-wasm-tfjs-backend-wasm":         at step (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:47:23)
Step #23 - "test-wasm-tfjs-backend-wasm":         at Object.next (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:28:53)
Step #23 - "test-wasm-tfjs-backend-wasm":         at /workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:22:71
Step #23 - "test-wasm-tfjs-backend-wasm":         at <Jasmine>
Step #23 - "test-wasm-tfjs-backend-wasm":         at __awaiter (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:18:12)
Step #23 - "test-wasm-tfjs-backend-wasm":         at UserContext.<anonymous> (/workspace/link-package-core/node_modules/@tensorflow/tfjs-core/dist/ops/binary_ops_test.js:118:44)
Step #23 - "test-wasm-tfjs-backend-wasm":         at <Jasmine>
Step #23 - "test-wasm-tfjs-backend-wasm":         at runCallback (timers.js:705:18)
Step #23 - "test-wasm-tfjs-backend-wasm":         at tryOnImmediate (timers.js:676:5)
Step #23 - "test-wasm-tfjs-backend-wasm":         at processImmediate (timers.js:658:5)
Step #23 - "test-wasm-tfjs-backend-wasm":         at process.topLevelDomainCallback (domain.js:126:23)
Step #23 - "test-wasm-tfjs-backend-wasm": Pending:
gaikwadrahul8 commented 1 year ago

Hi, @axinging

Apologize for the delayed response and we're re-visiting our older issues and checking whether those issues got resolved or not as of now so May I know are you still looking for the solution or your issue got resolved ?

If issue still persists after trying with latest version of TFJs please let us know with error log and code snippet to replicate the same issue from our end ?

Could you please confirm if this issue is resolved for you ? Please feel free to close the issue if it is resolved ? Thank you!

chunnienc commented 1 year ago

Hi @gaikwadrahul8,

TFJS wasm backend does not support complex dtype and all kernels/ops for complex tensors. I'm going to work on that support later this year. If you see any issues related to complex on wasm backend please assign to me, thanks!

google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.