tensorflow / tfjs

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

Kernel 'Transform' not registered for backend 'tensorflow' #6437

Open adityapatadia opened 2 years ago

adityapatadia commented 2 years ago

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

System information

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

rthadur commented 2 years ago

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

google-ml-butler[bot] commented 2 years 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.

adityapatadia commented 2 years ago

Keeping this open.

dougchestnut commented 2 years ago

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.

adityapatadia commented 1 year ago

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.

michaelzangl commented 1 year ago

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);
adityapatadia commented 1 year ago

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

gaikwadrahul8 commented 1 year ago

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!

adityapatadia commented 1 year ago

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 commented 11 months ago

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.

homerjam commented 10 months ago

+1

Reason: using node for face detection

mprynce commented 7 months ago

+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.

jmgarciasanti commented 5 months ago

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);

Adi1231234 commented 2 months ago

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

alswla commented 2 months ago

+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.

DmitryFX commented 2 months ago

+1

tfjs-node: 4.19.0

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

RGdevz commented 1 month ago

+1

expolli commented 1 week ago

+1