Object detection with predefined set and DAHUA IP-CAM

I manage to show my dahua IP cam frames in an image-preview node.
Now I like to do object detection on every frame with yolo or tensorflow and coco nodes.
All nodes mentioning tensorflow or yolo that I found in the palette seem not possible to install.
I use node-red 3.1.7 and got the errors below :

Does someone have an idea why all nodes can not be installed without problems? Thx!

C:\Users\Wim\.node-red>npm i node-red-contrib-tfjs-coco-ssd
npm WARN deprecated npmlog@5.0.1: This package is no longer supported.
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm WARN deprecated gauge@3.0.2: This package is no longer supported.
npm ERR! code 1
npm ERR! path C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! CPU-windows-3.21.1.zip
npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
npm ERR! * Downloading libtensorflow
npm ERR!
npm ERR! * Building TensorFlow Node.js bindings
npm ERR! symlink ./lib/napi-v9 failed:  Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
npm ERR!   * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.
npm ERR! node:internal/process/promises:289
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR!
npm ERR! [Error: ENOENT: no such file or directory, copyfile 'C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll' -> 'C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'] {
npm ERR!   errno: -4058,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'copyfile',
npm ERR!   path: 'C:\\Users\\Wim\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\deps\\lib\\tensorflow.dll',
npm ERR!   dest: 'C:\\Users\\Wim\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v9\\tensorflow.dll'
npm ERR! }
npm ERR!
npm ERR! Node.js v20.11.1
npm ERR!
npm ERR!     at ChildProcess.exithandler (node:child_process:422:12)
npm ERR!     at ChildProcess.emit (node:events:518:28)
npm ERR!     at maybeClose (node:internal/child_process:1105:16)
npm ERR!     at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
npm ERR!   code: 1,
npm ERR!   killed: false,
npm ERR!   signal: null,
npm ERR!   cmd: 'node scripts/deps-stage.js symlink ./lib/napi-v9'
npm ERR! }

npm ERR! A complete log of this run can be found in: C:\Users\Wim\AppData\Local\npm-cache\_logs\2024-06-24T17_23_32_216Z-debug-0.log

Your node js version ↑


searching this ↑ lead to this: Cant install on windows 11 · Issue #7793 · tensorflow/tfjs · GitHub which says it is a known issue & to use an earlier version of nodeJS. Note it does say use v19 or v18 but Node-RED is not tested against V19 (so if you intend on rolling back Node version, chose v18)

Lastly, this is not an issue on Linux. If you have a different computer running linux then that would be my first recommendation.

Thanks for your help I install nvm and now use node v18.20.3 but still got the error


-----------------------------------------------------------
2024-06-25T15:00:31.489Z Install : node-red-contrib-tfjs-coco-ssd 1.0.6

2024-06-25T15:00:31.807Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-tfjs-coco-ssd@1.0.6
2024-06-25T15:00:40.824Z [err] npm warn deprecated npmlog@5.0.1: This package is no longer supported.
2024-06-25T15:00:40.855Z [err] npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
2024-06-25T15:00:40.906Z [err] npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
2024-06-25T15:00:41.029Z [err] npm warn deprecated gauge@3.0.2: This package is no longer supported.
2024-06-25T15:01:13.948Z [err] npm error code 1
2024-06-25T15:01:13.948Z [err] npm error path C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node
2024-06-25T15:01:13.951Z [err] npm error command failed
2024-06-25T15:01:13.951Z [err] npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
2024-06-25T15:01:13.951Z [err] npm error CPU-windows-3.21.1.zip
2024-06-25T15:01:13.951Z [err] npm error https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
2024-06-25T15:01:13.951Z [err] npm error * Downloading libtensorflow
2024-06-25T15:01:13.951Z [err] npm error
2024-06-25T15:01:13.951Z [err] npm error * Building TensorFlow Node.js bindings
2024-06-25T15:01:13.951Z [err] npm error symlink ./lib/napi-v9 failed:  Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
2024-06-25T15:01:13.951Z [err] npm error   * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.
2024-06-25T15:01:13.951Z [err] npm error node:internal/process/promises:288
2024-06-25T15:01:13.951Z [err] npm error             triggerUncaughtException(err, true /* fromPromise */);
2024-06-25T15:01:13.951Z [err] npm error             ^
2024-06-25T15:01:13.951Z [err] npm error
2024-06-25T15:01:13.951Z [err] npm error [Error: ENOENT: no such file or directory, copyfile 'C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll' -> 'C:\Users\Wim\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'] {
2024-06-25T15:01:13.951Z [err] npm error   errno: -4058,
2024-06-25T15:01:13.951Z [err] npm error   code: 'ENOENT',
2024-06-25T15:01:13.951Z [err] npm error   syscall: 'copyfile',
2024-06-25T15:01:13.951Z [err] npm error   path: 'C:\\Users\\Wim\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\deps\\lib\\tensorflow.dll',
2024-06-25T15:01:13.951Z [err] npm error   dest: 'C:\\Users\\Wim\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v9\\tensorflow.dll'
2024-06-25T15:01:13.951Z [err] npm error }
2024-06-25T15:01:13.951Z [err] npm error
2024-06-25T15:01:13.951Z [err] npm error Node.js v18.20.3
2024-06-25T15:01:13.951Z [err] npm error
2024-06-25T15:01:13.951Z [err] npm error     at ChildProcess.exithandler (node:child_process:422:12)
2024-06-25T15:01:13.951Z [err] npm error     at ChildProcess.emit (node:events:517:28)
2024-06-25T15:01:13.951Z [err] npm error     at maybeClose (node:internal/child_process:1098:16)
2024-06-25T15:01:13.951Z [err] npm error     at ChildProcess._handle.onexit (node:internal/child_process:303:5) {
2024-06-25T15:01:13.951Z [err] npm error   code: 1,
2024-06-25T15:01:13.951Z [err] npm error   killed: false,
2024-06-25T15:01:13.951Z [err] npm error   signal: null,
2024-06-25T15:01:13.951Z [err] npm error   cmd: 'node scripts/deps-stage.js symlink ./lib/napi-v9'
2024-06-25T15:01:13.951Z [err] npm error }
2024-06-25T15:01:13.953Z [err] 
2024-06-25T15:01:13.953Z [err] npm error A complete log of this run can be found in: C:\Users\Wim\AppData\Local\npm-cache\_logs\2024-06-25T15_00_32_108Z-debug-0.log
2024-06-25T15:01:13.979Z rc=1

And your Python version??

I have python 3.9 3.11 and 3.12 on my pc, how to know which one will be used by the nodes? Thx.

In the link @Steve-Mcl posted it is written "use Node.js v18.16.1" while you say you have v18.20.3 so next I would do is to get that node.js version and check if that helps

Thanks a lot, with 18.16.1 it works on my win10 PC.

It worked also without any problems on the RP4, but slow.

Maybe RP5 + AI accelerator would be ok?

1 Like