TensorFlow giving me error every time I try to call a function

I am using TensorFlow and it gives me error every time I try to call model.classify().

Error: 'gather' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen

require('@tensorflow/tfjs-node');
require('@tensorflow/tfjs');
const toxicity = require('@tensorflow-models/toxicity');
const threshold = 0.9;
toxicity.load(threshold).then(model => {
  const sentences = ['you suck'];
  model.classify(sentences).then(predictions => {
    console.log(predictions);
  });
});

How do I fix this?

This is on your personal machine right? I was reading this GitHub issue and this can be fixed by upgrading other dependencies. Can you show us your package.json?

Yes this is on my personal machine since Glitch wouldn’t be able to keep up with it and so I can use all the tools I want and need such as Visual Studio Code.

{
  "name": "test",
  "version": "1.0.0",
  "description": "test",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "Daw588",
  "license": "ISC",
  "dependencies": {
    "@mapbox/node-pre-gyp": "^1.0.0",
    "@tensorflow-models/toxicity": "^1.2.2",
    "@tensorflow/tfjs": "^2.8.6",
    "@tensorflow/tfjs-node": "^2.8.6",
    "actions-on-google": "^2.13.0",
    "dialogflow": "^1.2.0",
    "discord.js": "^12.5.1",
    "express": "^4.17.1",
    "socket.io": "^3.1.1",
    "write-file-atomic": "^3.0.3"
  }
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.