Following are the versions of node-packages to reproduce the error
"face-api.js": "^0.22.2"
"@tensorflow/tfjs-backend-cpu": "^2.7.0"
"@tensorflow/tfjs-backend-webgl": "^2.7.0"
"@tensorflow/tfjs-converter": "^2.7.0"
"@tensorflow/tfjs-core": "^2.7.0"
I tried loading the tinyFaceDetectorModel, here is the code snippet
await faceapi.nets.tinyFaceDetector.loadFromUri('/models');
const input = document.querySelector("img");
const result = await faceapi.detectSingleFace(input,new faceapi.TinyFaceDetectorOptions());
It leads to this error:
backend.js?8b87:504 Uncaught (in promise) Error: 'multiply' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen
This looks like a regression in tensorflowjs, downgrading to 2.6.0 fixes the issue
This looks like a regression in tensorflowjs, downgrading to 2.6.0 fixes the issue
I downgraded to TF 2.6.0 and now it is giving some new error here it is:
Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
at parseTupleParam (conv_util.js?b818:239)
at tupleValuesAreOne (conv_util.js?b818:386)
at Module.eitherStridesOrDilationsAreOne (conv_util.js?b818:390)
at Object.maxPool [as kernelFunc] (MaxPool.js?898d:27)
at kernelFunc (engine.js?6ae2:425)
at eval (engine.js?6ae2:477)
at Engine.scopedRun (engine.js?6ae2:318)
at Engine.runKernelFunc (engine.js?6ae2:475)
at cl (tf-core.esm.js?953f:17)
at maxPool_ (tf-core.esm.js?953f:17)
@framp I think that downgrading didn't work
This works ok on my machine: https://gist.github.com/framp/ac13e105f0d1a4209b12047781321a7a
I am getting the excat same issue @archeelp
Did you find any solution ?
for what it's worth, I also get this error when using TFJS 2.7.0
backend.js:665 Uncaught (in promise) Error: 'multiply' 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.js:665)
at MathBackendWebGL.multiply (backend.js:176)
at Kt.runKernelFunc.a (face-api.min.js:1)
at engine.js:625
at engine.js:433
at Engine.scopedRun (engine.js:444)
at Engine.tidy (engine.js:431)
at kernelFunc (engine.js:625)
at engine.js:639
at Engine.scopedRun (engine.js:444)
But trying other 2.x releases (I tried TFJS 2.2.0, 2.3.0, 2.4.0, 2.5.0, 2.6.0) all threw this error
face-api.min.js:1 Uncaught (in promise) TypeError: t.batchNormalization is not a function
at Kt.runKernelFunc.x (face-api.min.js:1)
at engine.js:625
at engine.js:433
at Engine.scopedRun (engine.js:444)
at Engine.tidy (engine.js:431)
at kernelFunc (engine.js:625)
at engine.js:639
at Engine.scopedRun (engine.js:444)
at Engine.runKernelFunc (engine.js:636)
at yu (face-api.min.js:1)
_Update_: I've just seen that this was already reported/known
@dalelane I used TFJS 1.9 and it solved that error.
@shailjaa downgrading to TFJS 1.* will be a workaround.
But if you have other packages which have dependency requirements of TFJS version >= V2.0 it will again cause a series of errors.
it's well known that face-api is not compatible with tfjs 2.0+ - you just run into few issues (such as batchNormalization being deprecated so models need updating, not just JS code, etc.)
i've spend a lot of time to rewrite parts, if you wish you can check out https://github.com/vladmandic/face-api
Most helpful comment
it's well known that
face-apiis not compatible with tfjs 2.0+ - you just run into few issues (such asbatchNormalizationbeing deprecated so models need updating, not just JS code, etc.)i've spend a lot of time to rewrite parts, if you wish you can check out https://github.com/vladmandic/face-api