question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kernel 'RotateWithOffset' not registered for backend 'tensorflow'

See original GitHub issue

System information

  • I have written custom code
  • macOS Catalina 10.15.7
  • TensorFlow.js installed from npm
  • TensorFlow.js version 3.0.0
  • Browser version: Not in browser
  • Tensorflow.js Converter Version: 3.0.0

Describe the current behavior When running project with Node backend “tensorflow”, getting error:

(node:2424) UnhandledPromiseRejectionWarning: Error: Kernel 'RotateWithOffset' not registered for backend 'tensorflow'
    at Engine.runKernel(/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3053:19)
    at rotateWithOffset_ (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:20785:22)
    at Object.rotateWithOffset__op [as rotateWithOffset] (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3968:29)
    at HandPipeline.<anonymous> (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:161:49)
    at step (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:48:23)
    at Object.next (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:29:53)
    at fulfilled (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:20:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2424) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2424) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Describe the expected behavior Code works without errors

Steps to reproduce the issue

  1. npm install @tensorflow/tfjs-node
  2. Set tf backend to ‘tensorflow’
  3. Run standard example

Other info / logs

(node:2424) UnhandledPromiseRejectionWarning: Error: Kernel 'RotateWithOffset' not registered for backend 'tensorflow'
    at Engine.runKernel(/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3053:19)
    at rotateWithOffset_ (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:20785:22)
    at Object.rotateWithOffset__op [as rotateWithOffset] (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3968:29)
    at HandPipeline.<anonymous> (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:161:49)
    at step (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:48:23)
    at Object.next (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:29:53)
    at fulfilled (/Users/me/Documents/Projects/MCH/node_modules/@tensorflow-models/handpose/dist/pipeline.js:20:58)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:2424) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2424) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

7reactions
hyprstackcommented, Sep 10, 2021

Does this mean it’s currently impossible to run the @tensorflow-models/face-landmarks-detection model on a node server? I’m trying to run it in an expressJs server to move the heavy lifting from the browser.

From my package.json

 "@tensorflow-models/face-landmarks-detection": "0.0.3",
 "@tensorflow/tfjs-node": "^3.9.0",
const tf = require("@tensorflow/tfjs-node");
const faceLandmarksDetection = require("@tensorflow-models/face-landmarks-detection");
const { Buffer } = require("buffer");

....

     try {
      const model = await faceLandmarksDetection.load(
        faceLandmarksDetection.SupportedPackages.mediapipeFacemesh
      );
      const img = dataObj.data_url.replace(
        /^data:image\/(png|jpeg);base64,/,
        ""
      );
      const b = Buffer.from(img, "base64");
      const tensor = tf.node.decodeImage(b, 3);

      // Throws error => Error: Kernel 'RotateWithOffset' not registered for backend 'tensorflow'
      const preds = await model.estimateFaces({
        input: tensor,
      });
      console.log(preds);
    } catch (err) {
      console.log(err);
    }
1reaction
rasti90commented, May 19, 2021

I have the same problem. any update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creates a tf.Tensor with the provided values, shape and dtype.
cls (SerializableConstructor) The class to be registered. It must have a public static member called className defined and the value must be a...
Read more >
UNPKG - @tensorflow/tfjs-backend-cpu
n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the...
Read more >
tensorflow/tfjs-node: Error: Failed to load SavedModel: Op ...
You need to convert your model for Tensorflow Lite (with reduced ops). The error received is due to the lack of ops available...
Read more >
@tensorflow/tfjs-backend-webgl - npm package | Snyk
Learn more about @tensorflow/tfjs-backend-webgl: package health score, popularity, security, maintenance, versions and more.
Read more >
内核'rotatewithoffset'未注册后端'tensorflow' - 深度学习
Kernel 'RotateWithOffset' not registered for backend 'tensorflow'500: Internal Server Error500: Internal Server Error I have written custom ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found