Tensorflow JS - Examples - Setup

Hi - new to tf and tf-js. Working my way thru the examples project , but running into (what I think are) node-gyp related issues when running npm install and node-gyp configure.

UPDATE - seems like one problem is that npm does not quite work - when I use yarn, I can get some of the examples to work. But still getting node-gyp errs on other examples.

Environment
Windows 10 - 22H2 - 19045.3803
IntelliJ - 2023.2
NodeJS - 18.12.1
Python - 3.12.1
VS Build Tools - 2022

  • MSVC v143 - VS 2022 C++ x64
  • Windows 10 SDK (10.0.22000.0)
  • C++ CMake Tools for Windows
  • Testing Tools Core Features - Build Tools

Issues
executing - node-gyp configure

gyp: binding.gyp not found (cwd: I:\APPS\APPS-EDU-MACH LEARN-TF-2024\apps-edu-mach learn-tf20-google-tfjs-examples
) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess. (D:\PROGRAMS-DEV-LANG-JS-NVM\v18.12.1\node_modules\node-gyp\lib\configu
re.js:271:18)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command “D:\PROGRAMS-DEV-LANG-JS-NODEJS\node.exe” “D:\PROGRAMS-DEV-LANG-JS-NODEJS\node_modules\node-
gyp\bin\node-gyp.js” “configure”
gyp ERR! cwd I:\APPS\APPS-EDU-MACH LEARN-TF-2024\apps-edu-mach learn-tf20-google-tfjs-examples
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v10.0.1
gyp ERR! not ok

Questions

  1. I had assumed that the examples project was ready-to-go. I have no idea how to cfg binding.gyp…
  • can anyone point me to the docum that explains how to set up binding.gyp (in general)?
  • is a separate binding.gyp needed for each example?
  • given that this is intended to be a showcase form tf-js, are there off-the-shelf binding.gyp files
  1. Other
  • other than running node-gyp configure, is there any other set up needed for these examples?
  1. IntelliJ IDEA
  • I hate to ask this, but does tf-js even work with IntelliJ - it seems that the bias is towards VS.

Thx in advance!

Hi, @IMTanuki

Welcome to TensorFlow Forum!

I apologize for the delayed response, To better assist you with the issues you’re encountering with tfjs-examples, could you please specify which examples are causing problems?

I see you mentioned using Python 3.12, could you also try running them with Node.js 19.9.0 and either Python 3.10 or Python 3.11 and see is it resolving your issue ?

Once you provide me with the specific tfjs-examples details which are not working, I will go ahead and replicate the issue on my end and offer further assistance.

Thank you for your cooperation and patience.

Sorry, I had so many problems getting the examples and demos working that I started exploring tfjs via the google yt course. so far, so good.

when I complete the course, I’ll come back to these examples and demos.

thx!

1 Like

Glad you are finding my course useful! :slight_smile: Good luck!

Could you PM me - I have some feedback regarding the course that I’d prefer to share offline.

Thx!

Sure will follow up over on a direct message. Thanks!