Skip to content
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

Unable to install tensor flow in node red #8081

Closed
pratheeshmanoh opened this issue Nov 27, 2023 · 4 comments
Closed

Unable to install tensor flow in node red #8081

pratheeshmanoh opened this issue Nov 27, 2023 · 4 comments

Comments

@pratheeshmanoh
Copy link

npm WARN config production Use --omit=dev instead.
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see request/request#3142
npm ERR! code 1
npm ERR! path C:\Users\DELL 7400.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-4.1.0.zip
npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
npm ERR! node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.9
npm ERR! node-pre-gyp info using node@18.17.1 | win32 | x64
npm ERR! node-pre-gyp info check checked for "C:\Users\DELL 7400.node-red\node_modules@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node" (not ...

@gaikwadrahul8
Copy link
Contributor

Hi, @pratheeshmanoh

Thank you for bringing this issue to our attention and could you please give it try by downgrading the Node.js version to 18.16.1 and please try with python 3.8,3.9 or 3.10 versions

Please try to install @tensorflow/tfjs-node@3.18.0 or @tensorflow/tfjs-node@3.10.0 by using below command and let us know is it working as expected or not ? if issue still persists please help us with error log to investigate your issue further.

npm install --save-exact @tensorflow/tfjs-node@3.18.0 or npm install --save-exact @tensorflow/tfjs-node@3.10.0

I believe you're following these official documentation Ref-1, Ref-2 and node-gyp - Node.js native addon build tool for Windows

In general you'll have to follow below steps to install @tensorflow/tfjs-node on Windows system:

  • Edit the path user or system variable, ensure that the path to python is added to the path variable.
  • Install Visual Studio community edition with desktop development with C++ Link
  • Install visual studio build tools with the help of Visual Studio Installer
  • Ensure that node-gyp is available: npm install -g node-gyp
  • Install tfjs-node: either npm install --save-exact @tensorflow/tfjs-node@3.18.0 or npm install --save-exact @tensorflow/tfjs-node@3.10.0

Please let us know after trying above steps is it resolving your issue or not ? if not please help us with error log to investigate this issue further

Thank you!

Copy link

github-actions bot commented Dec 5, 2023

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Dec 5, 2023
@gaikwadrahul8
Copy link
Contributor

Hi, @pratheeshmanoh

I'm able to install tfjs-node on my windows 10 system by following the instructions mentioned in my previous comment with these Node.js versions Node.js v19.9.0 Node.js v18.16.1 and at the moment it's not working as expected with Node.js version v20.10.0 and our relevant team is working on this issue to fix it

You should able to install tfjs-node on your windows system with Node.js versions Node.js v19.9.0 Node.js v18.16.1 so now I'm closing this issue, if you face any issue while installing tfjs-node after following above mentioned instructions with mentioned Node.js versions please feel free to create new issue with your new error log and would be glad to help you further

Thank you for your understanding and patience.

  1. With Node.js v19.9.0 :
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> python
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> node -v
v19.9.0
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> npm -v
9.6.3
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> pyenv which python
C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> npm install -g node-gyp --python="C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe”   

changed 99 packages in 6s
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> npm install --python="C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe" @tensorflow/tfjs-node

changed 10 packages, and audited 120 packages in 51s

9 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node19-py-3.10> 
  1. with Node.js v18.16.1 :
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> python
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> node --version
v18.16.1
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> npm --version
9.8.0
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> pyenv which python
C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> npm install -g node-gyp --python="C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe"   

changed 99 packages in 12s

14 packages are looking for funding
  run `npm fund` for details
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> npm install --python="C:\Users\gaikwadrahul\.pyenv\pyenv-win\versions\3.10.9\python.exe" @tensorflow/tfjs-node

added 121 packages, and audited 122 packages in 3m

9 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> node .\index.js
2023-11-30 15:04:31.614170: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Epoch 1 / 3
eta=0.0 ==================================================================================> 
29686ms 2969us/step - MAE=0.332 loss=0.168 val_MAE=0.293 val_loss=0.126 
Epoch 2 / 3
eta=0.0 ==================================================================================>
9458ms 946us/step - MAE=0.279 loss=0.113 val_MAE=0.271 val_loss=0.106 
Epoch 3 / 3
eta=0.0 ==================================================================================> 
11791ms 1179us/step - MAE=0.258 loss=0.0940 val_MAE=0.275 val_loss=0.110 
PS C:\Users\gaikwadrahul\Desktop\tfjs-node-testing-for-doc\tfjs-node-3.10> 

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants