Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template
System information
Describe the current behavior
WebGL CPU forward failed to slice op, caused by CPU slice op has been modularized.
backend.ts:665 Uncaught (in promise) Error: 'slice' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen
at notYetImplemented (backend.ts:665)
at MathBackendCPU.KernelBackend.slice (backend.ts:145)
at MathBackendWebGL.slice (backend_webgl.ts:731)
at forward (slice.ts:75)
at engine.ts:625
The current work-around is to disable CPU forwarding:
tf.env().set('WEBGPU_CPU_FORWARD', false);
Describe the expected behavior
In 2.4.0 the CPU forwarding of slice op is not failing.
Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/CodePen/any notebook.
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.
I got the similar error today:
tfjs:17 Uncaught (in promise) Error: 'slice' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen
at av (tfjs:17)
at t.slice (tfjs:17)
at t.n.slice (tfjs:17)
at tfjs:17
at tfjs:17
at tfjs:17
at e.t.scopedRun (tfjs:17)
at e.t.tidy (tfjs:17)
at p (tfjs:17)
at tfjs:17
I guess the cdn just using the latest release. I resolved the issue by changing:
from:
importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs');
to:
importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core');
importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter');
importScripts('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl');
Is that expected? I think it is a bug.
I got the same error. I tried tf.env().set('WEBGPU_CPU_FORWARD', false); but it doesn't work. However, tf.env().set('WEBGL_CPU_FORWARD', false); does
+1 same issue happening here after upgrading "@tensorflow/tfjs" from 2.4.0 to 2.5.0
adding tf.env().set('WEBGL_CPU_FORWARD', false); solves...
+1 Same here.
+1 same here
When will the fix be available in a public release? I'm still seeing the issue when using one of the official mirrors of TFJS: https://cdn.jsdelivr.net/npm/@tensorflow/tfjs/dist/tf.min.js which still seems to be pulling down 2.5.0
We published 2.6.0 today, it should fix the problem by now.
Problem solved on my side with 2.6.0! Kudos to the TFjs team for the prompt resolution! :)
Hi, I had the same error that is resolved with tfjs 2.6.0 but now I still have an other error when executing my model.
The model's input is a tensor created from an image with tf.browser.fromPixels()
"ERROR Error: Uncaught (in promise): Error: Argument 'x' passed to 'expandDims' must be a Tensor or TensorLike, but got 'Promise'"
I have this same kind of error (with an other function than "expandDims" displayed in the error) since the first time I used tfjs.
Error appears only when i use tfjs>=2.0, with tfjs=1.X i do not have error of this kind.
I have tried with models trained with python TF object detection api for TF 1.X and TF 2.X and I have the same error for both.
Thank you for your help.
Hi @rfourdinier, can you open another issue with this other bug you found, and preferably some code snippet to help us reproduce the error. Thank you!
Hello @lina128 i have opened issue #4062 thanks