-
Notifications
You must be signed in to change notification settings - Fork 1.9k
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run @tensorflow/tfjs-node on OSX #2873
Comments
Hi Sasha, I just tried the library on my machine with node v12.16.0 and v13.11.0, it works with both version. So I will need some more information to find the issue on you machine.
|
Thank you @kangyizhang, (Sorry for the delay, gmail classified email in forums, added better rules now) For your convenience, here is the demo repo: https://github.com/mprinc/tfjs-node-test Here is the content of the zip -r tfjs-node_deps.zip node_modules/@tensorflow/tfjs-node/deps/*
adding: node_modules/@tensorflow/tfjs-node/deps/LICENSE (deflated 65%)
adding: node_modules/@tensorflow/tfjs-node/deps/THIRD_PARTY_TF_C_LICENSES (deflated 78%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api_experimental.h (deflated 71%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/c_api.h (deflated 78%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_status.h (deflated 56%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_attrtype.h (deflated 49%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_datatype.h (deflated 54%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/tf_tensor.h (deflated 65%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/deps/include/tensorflow/c/eager/c_api.h (deflated 74%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.dylib (deflated 80%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow_framework.1.dylib (deflated 71%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.1.15.0.dylib (deflated 80%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.1.dylib (deflated 80%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow_framework.1.15.0.dylib (deflated 71%)
adding: node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow_framework.dylib (deflated 71%) Here is the content of the zip -r tfjs-node_lib.zip node_modules/@tensorflow/tfjs-node/lib/*
adding: node_modules/@tensorflow/tfjs-node/lib/napi-v4/ (stored 0%)
adding: node_modules/@tensorflow/tfjs-node/lib/napi-v4/tfjs_binding.node (deflated 68%) |
This is the full error message: node dist/index.js
[tfjs-test] started
internal/modules/cjs/loader.js:979
throw err;
^
Error: Cannot find module '/Users/mprinc/data/development/ML/tfjs-node-test/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node'
Require stack:
- /Users/mprinc/data/development/ML/tfjs-node-test/node_modules/@tensorflow/tfjs-node/dist/index.js
- /Users/mprinc/data/development/ML/tfjs-node-test/dist/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/mprinc/data/development/ML/tfjs-node-test/node_modules/@tensorflow/tfjs-node/dist/index.js:46:16)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1036:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/mprinc/data/development/ML/tfjs-node-test/node_modules/@tensorflow/tfjs-node/dist/index.js',
'/Users/mprinc/data/development/ML/tfjs-node-test/dist/index.js'
]
} |
I cannot reproduce the error 100% anymore. What I experienced now is that the error gets with upgrading/downgrading node (a month ago, with older tfjs versions it didn't matter). Older node versions build |
@mprinc Yes you are correct. The node addon module (tfjs_binding.node) is compiled to a folder whose name include the N-API version. So if you installed the library in node.js with N-API version 4, the node addon module is stored as Please feel free to re-open if you have any other issue. |
Thanks @kangyizhang . I hope for the best :) |
TensorFlow.js version
"name": "@tensorflow/tfjs-node",
"version": "1.7.0",
macOS Catalina
v10.15.03
node -v
Anything between the v12.11.1 and @latest (currently v13.10.1)
Tested with:
Describe the problem or feature request
@kangyizhang I tried all various suggestions from the (closed) #2003 still issues with latest node.
Still the same error "Error: Cannot find module '.../node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node'"
With "@tensorflow/tfjs-node" I managed now with the latest version 1.7.0, but ONLY using earlier node:
node -v
v12.10.0
(the next v12.11.1 is crashing, also the same with the currently latest node v13.10.1)
Obviously, this is far from ideal as we need to propagate node version changes on the production servers, and as we have both frontend and backend tf, we might need to reduce frontend version to not risk compatibility issues or keep them version-async (as with the previous versions it was crashing on the backend so I HAD to reduce tfjs on v1.5.2, etc)
And even then I get the incompatibility issue with compiling aspect:
And I get the more expected warning :) "Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA"
Code to reproduce the bug / link to feature request
Here is the minimal code:
package.json
ts
js
Here is also JS compiled version:
tsconfig.js
The text was updated successfully, but these errors were encountered: