user3887128
user3887128

Reputation: 1

TypeError: Cannot read property 'nonMaxSuppressionV3Impl' of undefined

I was trying to use @tensorflow/tfjs-node module in Node.js express web server. But, I am getting the below error. I failed to understand why am I getting this error. I have just added 1 line code in the node.js server. The installation I have done using "npm install @tensorflow/tfjs-node" . What could be the possible issue?

var tf = require ('@tensorflow/tfjs-node');

Thanks in advance,

var nonMaxSuppressionV3Impl = tf.kernel_impls.nonMaxSuppressionV3Impl; ^ TypeError: Cannot read property 'nonMaxSuppressionV3Impl' of undefined at Object. (C:\reactjs\BGR\rbg-master\node_modules@tensorflow\tfjs-backend-cpu\dist\tf-backend-cpu.node.js:358:47) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Module.require (internal/modules/cjs/loader.js:848:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (C:\reactjs\BGR\rbg-master\node_modules@tensorflow\tfjs-node\node_modules@tensorflow\tfjs\dist\tf.node.js:25:22) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)

Upvotes: 0

Views: 733

Answers (1)

Michael Depp
Michael Depp

Reputation: 11

I had the same issue with the 2.3.0 version of @tensorflow/tfjs-node-gpu.

I try to downgrade @tensorflow/tfjs-node-gpu to version 1.7.4. & it worked normally. You might ask, why that particular version, cause few months back I did an application using tensorflow-node-gpu and that version was the latest that time. And when I run into this error, I try to open that application and it still works. So, I just downgraded it to 1.7.4, and it works

Just follow this steps :-

  1. npm remove @tensorflow/tfjs-node-gpu
  2. npm i @tensorflow/[email protected]

Let me know, if it helps. TQ

Upvotes: 1

Related Questions