tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

Kernel 'Transform' not registered for backend 'tensorflow'

Open adityapatadia opened this issue 3 years ago • 19 comments

I am trying to use this repo but getting above error: https://www.npmjs.com/package/@tensorflow-models/face-detection

System information

  • TensorFlow.js version (you are using): 3.18
  • Are you willing to contribute it (Yes/No): No

There is some issue and this model is unable to run on tfjs-node.

adityapatadia avatar May 22 '22 19:05 adityapatadia

Transform is not implemented for tfjs-node , this will be a feature request .Any specific reason you are using tfjs-node? Thank you

rthadur avatar May 24 '22 00:05 rthadur

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.

google-ml-butler[bot] avatar May 31 '22 01:05 google-ml-butler[bot]

Keeping this open.

adityapatadia avatar May 31 '22 11:05 adityapatadia

I just ran into this issue using nodejs. Reason for using tfjs-node, i'm attempting to run face detection on a large collection of images with node. Using node/javascript as it seemed to be the easiest pathway to get started with tensorflow currently. I had no problem using the pre-trained classification and object detection models but ran into this issue with detecting faces.

dougchestnut avatar Jun 10 '22 16:06 dougchestnut

We are doing inference on server side and I think it’s recommended to use it for speed and efficiency.

On 24-May-2022, at 6:17 AM, Rajeshwar Reddy T @.***> wrote:

 Transform is not implemented for tfjs-node , this will be a feature request .Any specific reason you are using tfjs-node? Thank you

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

adityapatadia avatar Oct 11 '22 07:10 adityapatadia

Workaround is to use the CPU backend which is slower but works:

    tf.setBackend('tensorflow'); // < required for decodeImage
    const imageData = await promisify(fs.readFile)(sourceDir + '/' + fileName);
    const image = await tf.node.decodeImage(imageData, 3);
    tf.setBackend('cpu');
    const model = SupportedModels.MediaPipeFaceDetector;
    const detector = await createDetector(model, {runtime: 'tfjs', maxFaces: 1});
    const predictions = await detector.estimateFaces(image);

michaelzangl avatar Nov 17 '22 21:11 michaelzangl

Is this fixed in newer versions? It seems we are not able to use new face-detection because of this.

adityapatadia avatar Dec 15 '22 09:12 adityapatadia

Hi, @adityapatadia

Apologize for the delayed response and we are re-visiting our older feature requests and checking whether those feature requests implemented or not as of now and It seems like Face Detection model won't run on tfjs-node you can check package.json file so May I know are you still looking to support this Face Detection model to run on tfjs-node ?

If someone wants to contribute for this feature then you're always welcome and please feel free to do and please refer these links Ref-1Ref-2 . Thank you!

gaikwadrahul8 avatar May 09 '23 06:05 gaikwadrahul8

We will still benefit from this feature and ability to run face detect model on tfjs-node—Regards,Aditya PatadiaOn 09-May-2023, at 2:47 PM, gaikwadrahul8 @.***> wrote: Hi, @adityapatadia Apologize for the delayed response and we are re-visiting our older feature requests and checking whether those feature requests implemented or not as of now and It seems like Face Detection model won't run on tfjs-node you can check package.json file so May I know are you still looking to support this Face Detection model to run on tfjs-node ? If someone wants to contribute for this feature then you're always welcome and please feel free to do and please refer these links Ref-1, Ref-2 . Thank you!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

adityapatadia avatar May 09 '23 09:05 adityapatadia

Hi team, We (and I think anyone running on Nodejs) will benefit from this feature in tfjs-node. Face detection is very widespread use-case and speeding it up is essential for us. Without this, we are forced to use older blazeface repo.

adityapatadia avatar Aug 06 '23 19:08 adityapatadia

+1

Reason: using node for face detection

homerjam avatar Aug 14 '23 11:08 homerjam

+1

I'm developing with TFJS for React Native, but learning about TF and writing some test cases with TFJS-node. It would be great to write working code under tfjs-node and then easily move that code over to RN.

mprynce avatar Nov 27 '23 18:11 mprynce

Same error for me. I'd like to process a "batch" of pictures using NodeJS but "estimatePoses" from posedetection.PoseDetector throws Kernel 'Transform' not registered for backend 'tensorflow'. I'm initializing the PoseDetector with this simple code:

const modelConfig: posedetection.BlazePoseTfjsModelConfig = { modelType: "full", enableSmoothing: true, runtime: "tfjs" };

const model:posedetection.PoseDetector = await posedetection.createDetector(posedetection.SupportedModels.BlazePose, modelConfig);

jmgarciasanti avatar Feb 09 '24 16:02 jmgarciasanti

Hi! I've also encountered the noted error. Are there any updates on resolving this issue, or any recommendations for alternative methods or tools for face detection that are effective with TensorFlow.js in a Node.js environment? Thanks

Adi1231234 avatar Apr 26 '24 16:04 Adi1231234

+1 Hi, I've also encountered the error Kernel 'Transform' not registered for backend 'tensorflow' while using @tensorflow/tfjs-node for face detection.

It would be appreciated if anyone could suggest alternative methods for face detection or provide guidance on how to resolve this issue.

Thanks.

alswla avatar May 03 '24 04:05 alswla

+1

tfjs-node: 4.19.0

tfjs-node: Error: Kernel 'Transform' not registered for backend 'tensorflow'

DmitryFX avatar May 04 '24 23:05 DmitryFX