おのたく日記 YouTubeも始めました→
2022-12-05(Mon) [長年日記]
■ [Node-Red] tensorflowバッケージを0.2.2から0.3.1にupgradeしたら
「不明なノードが存在するため、フローを停止しました cocossd」となってしまった。
ログでは
node-red-node-red-1 | 2 Dec 08:51:02 - [warn] [node-red-contrib-tensorflow/node] Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /data/node_modules/node-red-contrib-tensorflow/node_modules/@tensorflow/tfjs-node/lib/napi-v8/../../deps/lib/libtensorflow.so.2)
ld-linux-x86-64.so.2が足りないらしい。
/lib64/ld-linux-x86-64.so.2 libc6-compat v3.16 main x86_64
[AlpineLinux libc6-compatバッケージの内容より引用]
ということなので、
$ docker compose exec -u root node-red bash
bash-5.1# apk add --no-cache libc6-compat
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/3) Upgrading musl (1.2.3-r0 -> 1.2.3-r2)
(2/3) Upgrading musl-dev (1.2.3-r0 -> 1.2.3-r2)
(3/3) Installing libc6-compat (1.2.3-r2)
OK: 270 MiB in 70 packages
bash-5.1# ls /lib64
ld-linux-x86-64.so.2
bash-5.1# exit
$ docker compose restart
[+] Running 1/1
⠿ Container node-red-node-red-1 Started
$
したけど変わらない・・・
仕方ないので、まず node-red-contrib-tensorflowを0.3.1から元の0.2.2に戻す
bash-5.1# npm install node-red-contrib-tensorflow@0.2.2
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN eprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
added 123 packages, and audited 418 packages in 41s
39 packages are looking for funding
run `npm fund` for details
12 vulnerabilities (10 low, 1 moderate, 1 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
これだけではだめで @tensorflow/tfjs-node も元に戻す。
元のバージョンを忘れたので、最新版の4.xが問題みたいなので3.xの最新版の3.21.1を入れてみる。
bash-5.1# cd /data
bash-5.1# npm install @tensorflow/tfjs-node@3.21.1
added 52 packages, and audited 347 packages in 1m
42 packages are looking for funding
run `npm fund` for details
6 vulnerabilities (5 low, 1 moderate)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
bash-5.1$ npm ls
node-red-project@0.0.1 /data
├── @tensorflow/tfjs-node@3.21.1
├── node-red-contrib-browser-utils@0.0.11
├── node-red-contrib-castv2@4.2.2
├── node-red-contrib-crypto-js-dynamic@0.1.22
├── node-red-contrib-google-cloud@0.0.26
├── node-red-contrib-image-output@0.6.3
├── node-red-contrib-tensorflow@0.2.2
├── node-red-dashboard@3.2.3
├── node-red-node-feedparser@0.3.0
└── node-red-node-twitter@1.2.0
これてバージョンが固定されたので、Node-Redがバージョンアップしたら前提のDockerイメージAlpineが上がって治りそうなのて
bash-5.1# cd /data
bash-5.1# npm install @tensorflow/tfjs-node@latest node-red-contrib-tensorflow@latest
で最新版に戻してテストしてみよう。(忘れそう)
|