GithubHelp home page GithubHelp logo

Comments (4)

gaikwadrahul8 avatar gaikwadrahul8 commented on May 27, 2024

Hi, @satendra-cotginanalytics

Thank you for bringing this issue to our attention and I would suggest you to please follow below steps with Node v19.9.0 and different Python versions like 3.6, 3.7, 3.8, 3.9,3.10 or 3.11, if it did not work then please try with this specific versions Node v18.16.1, Pyhton 3.9.13, node-gyp 10.0.1, npm 9.5.1 and it should work

  • Step 1-: Create new folder and move to that folder by using cd folder_name then run command npm init -y it will create empty Node.js project
  • Step 2-: npm install -g node-gyp Or sudo npm install -g node-gyp
  • Step 3-: Download the Visual Studio Build Tools and select the Desktop development C++ (keep it default settings option)
  • Step 4 -: node-gyp configure --msvs_version=2017 Or sudo node-gyp configure --msvs_version=2017 (run this command and replace --msvs_version value with your downloaded Visual Studio build tool version)
  • Step 5-: set npm_config_python="C:\path\to\python.exe" Or sudo set npm_config_python="C:\path\to\python.exe(Replace your python.exe path in double quotes )
  • Step 6-: go to your project directory and try to install (npm install @tensorflow/tfjs-node Or sudo npm install @tensorflow/tfjs-node)

tfjs-node requires AVX processors and tfjs-node library uses AVX instructions to improve the performance of its operations. If your CPU does not support AVX, as far I know you will not be able to use tfjs-node if I'm not wrong so to check AVX support please follow below steps

  • Right-click on the Start button and select "System Information."
  • Expand the "Processor" category in the left-hand pane.
  • Look for "Instruction Set" or "Extended Instructions" in the right-hand pane. If AVX is supported, you should see it listed there (e.g., "AVX2").

I tried from my end and tfjs-node installing successfully and I ran sample model training code and it's working as expected, for your reference I have added output log below :

PS C:\Users\gaikwadrahul\Desktop\test-8202> node -v
v19.9.0
PS C:\Users\gaikwadrahul\Desktop\test-8202> npm -v
9.6.3
PS C:\Users\gaikwadrahul\Desktop\test-8202> python
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
PS C:\Users\gaikwadrahul\Desktop\test-8202> npm init -y
PS C:\Users\gaikwadrahul\Desktop\test-8202> npm install -g node-gyp

changed 101 packages in 12s
PS C:\Users\gaikwadrahul\Desktop\test-8202> npm install @tensorflow/tfjs-node

up to date, audited 122 packages in 1s

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

found 0 vulnerabilities
PS C:\Users\gaikwadrahul\Desktop\test-8202> node .\index.js
2024-03-18 12:04:54.474812: 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 / 10
eta=0.0 ==================================================================================>
3073ms 307us/step - MAE=0.327 loss=0.166 val_MAE=0.303 val_loss=0.138
Epoch 2 / 10
eta=0.0 ==================================================================================>
2017ms 202us/step - MAE=0.277 loss=0.110 val_MAE=0.259 val_loss=0.0947
Epoch 3 / 10
eta=0.0 ==================================================================================>
2126ms 213us/step - MAE=0.261 loss=0.0944 val_MAE=0.252 val_loss=0.0883
Epoch 4 / 10
eta=0.0 ==================================================================================>
2123ms 212us/step - MAE=0.253 loss=0.0875 val_MAE=0.247 val_loss=0.0837
Epoch 5 / 10
eta=0.0 ==================================================================================>
1960ms 196us/step - MAE=0.250 loss=0.0851 val_MAE=0.243 val_loss=0.0803
Epoch 6 / 10
eta=0.0 ==================================================================================>
2440ms 244us/step - MAE=0.250 loss=0.0847 val_MAE=0.244 val_loss=0.0814
Epoch 7 / 10
eta=0.0 ==================================================================================>
1754ms 175us/step - MAE=0.249 loss=0.0843 val_MAE=0.296 val_loss=0.131
Epoch 8 / 10
eta=0.0 ==================================================================================>
2062ms 206us/step - MAE=0.248 loss=0.0838 val_MAE=0.242 val_loss=0.0793
Epoch 9 / 10
eta=0.0 ==================================================================================>
1721ms 172us/step - MAE=0.249 loss=0.0841 val_MAE=0.242 val_loss=0.0792
Epoch 10 / 10
eta=0.0 ==================================================================================>
1703ms 170us/step - MAE=0.248 loss=0.0837 val_MAE=0.246 val_loss=0.0825
PS C:\Users\gaikwadrahul\Desktop\test-8202> 

Thank you for your understanding and patience.

from tfjs.

gaikwadrahul8 avatar gaikwadrahul8 commented on May 27, 2024

Hi, @satendra-cotginanalytics

To confirm, were you able to successfully install tfjs-node on your Windows system by following the provided instructions and workaround? If the installation was successful and able to run your code without any errors , please feel free to close this issue.

If you're still encountering problems, please provide us with a new error log and your code snippet after attempting the instructions and workaround. This will help us investigate the issue further on our end.

Thank you for your cooperation and patience in resolving this matter.

from tfjs.

satendra-cotginanalytics avatar satendra-cotginanalytics commented on May 27, 2024

Yes all issues resolved.

Thanks.👍❤️❤️

from tfjs.

google-ml-butler avatar google-ml-butler commented on May 27, 2024

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

from tfjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.