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

Unsupported system error when installing on M1 / Apple Silicon #4514

Closed
nickplee opened this issue Jan 9, 2021 · 102 comments · Fixed by #5899
Closed

Unsupported system error when installing on M1 / Apple Silicon #4514

nickplee opened this issue Jan 9, 2021 · 102 comments · Fixed by #5899
Assignees

Comments

@nickplee
Copy link

nickplee commented Jan 9, 2021

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 11.0.1 (20B29)
  • TensorFlow.js installed from (npm or script link): npm
  • TensorFlow.js version: 2.8.3

Describe the problem

Installation fails due to a missing precompiled libtensorflow for darwin / arm64.

Apple has their own fork of TensorFlow supporting their chips-- is there a way to tell the installation script to use their libtensorflow.dylib?

Provide the exact sequence of commands / steps that you executed before running into the problem

npm install @tensorflow/tfjs-node --save

Any other info / logs

npm ERR! code 1
npm ERR! path /Users/nicklee/Documents/Development/<redacted>/src/<redacted>/node_modules/@tensorflow/tfjs-node
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! CPU-darwin-2.8.3.tar.gz
npm ERR! * Downloading libtensorflow
npm ERR! /Users/nicklee/Documents/Development/<redacted>/src/<redacted>/node_modules/@tensorflow/tfjs-node/scripts/install.js:100
npm ERR!     throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
npm ERR!           ^
npm ERR! 
npm ERR! Error: Unsupported system: cpu-darwin-arm64
npm ERR!     at getPlatformLibtensorflowUri (/Users/nicklee/Documents/Development/<redacted>/src/<redacted>/node_modules/@tensorflow/tfjs-node/scripts/install.js:100:11)
npm ERR!     at downloadLibtensorflow (/Users/nicklee/Documents/Development/<redacted>/src/<redacted>/node_modules/@tensorflow/tfjs-node/scripts/install.js:134:7)
npm ERR!     at async run (/Users/nicklee/Documents/Development/<redacted>/src/<redacted>/node_modules/@tensorflow/tfjs-node/scripts/install.js:197:5)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nicklee/.npm/_logs/2021-01-09T02_53_09_673Z-debug.log
@pyu10055
Copy link
Collaborator

@nickplee thank you for reporting this, can you help to test it out following the instruction of custom TF build
https://github.com/tensorflow/tfjs/tree/master/tfjs-node#optional-build-optimal-tensorflow-from-source

@yhwang any suggestions on this? thanks.

@yhwang
Copy link
Contributor

yhwang commented Jan 11, 2021

since the tfjs-node@2.8.3 is using tensorflow shared libs v1.15.0, I think it's better to build the dependent shared libs by using the link @pyu10055 posted above. However, the tricky part would be tweaking the tensorflow to build on darwin arm64. It's okay by using ubuntu with arm64 to build tensorflow shared libs. But I am not sure about darwin with arm64.

For the tensorflow apple provides, you can verify whether you can find all files in this tarball from the binaries that apple provides. If yes, you can just put them under node_modules/@tensorflow/tfjs-node/lib/deps where you install the tfjs-node npm package. Then you can run npm run build-addon-from-source under node_modules/@tensorflow/tfjs-node. It will build the node binding for you. If everything goes well, you can try to use tfjs-node. Again, seems apple provides newer version then 1.15.0, I don't know if you can run tfjs-node without any issue even you can build the node binding successfully.

@yhwang
Copy link
Contributor

yhwang commented Jan 11, 2021

@pyu10055 a side question: any idea of supporting more platforms and architectures officially?

@nickplee
Copy link
Author

nickplee commented Jan 12, 2021

@yhwang @pyu10055

I actually already tried subbing in the Apple library and recompiling the binding. Once you install it, it includes the dylib as well as the headers.

I was hopeful, but ran in to two issues:

  • TF_StringDecode, TF_StringEncode, and TF_StringEncodedSize are used by the binding and were deprecated/removed from the TensorFlow C API in 2.4.0
  • After removing the usages of those functions (and replacing them with what I think is the right alternative implementation) the compiled binding crashed in weird ways. I don't know enough about TensorFlow to be able to explain in more detail unfortunately.

@pyu10055
Copy link
Collaborator

pyu10055 commented Jan 14, 2021

@yhwang It would definitely be useful to official support other platforms officially, but no plan as this moment, might be a good project for the SIG, any suggestions are welcome.

@nickplee Do you mind contriubting your fix attempt as an PR?

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

@patrickhulce
Copy link

Perhaps with tensorflow/tensorflow#45404 this is more feasible? Has anyone been able to get tfjs-node to work on an M1 device?

We're extremely interested in this as well. If anyone has been able to get it working, we would very, very much appreciate some pointers :)

@google-ml-butler
Copy link

Closing as stale. Please @mention us if this needs more attention.

@google-ml-butler
Copy link

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

@patrickhulce
Copy link

Can this be reopened or someone point us in the direction of where we should go to help? Support for the new M1 macs is essential for any applications running edge TF models.

@rthadur rthadur reopened this Feb 1, 2021
@rthadur
Copy link
Contributor

rthadur commented Feb 1, 2021

@patrickhulce reopened

@patrickhulce
Copy link

Thank you @rthadur! Is there anything that we can help with? My current understanding based on #4514 (comment) is that there a few patches (possibly that @nickplee already has written?) to work with the 2.4 API or attempt to rebuild 2.3 using the methods described in tensorflow/tensorflow#45404.

My M1 rig is arriving this week, so I'll be able to provide more hands-on assistance then if I know where I can be helpful :)

@rthadur
Copy link
Contributor

rthadur commented Feb 1, 2021

Gentle ping for @pyu10055

@zholmes1
Copy link

zholmes1 commented Mar 2, 2021

Just chiming in - I wasn't able to get tfjs/node working on my M1. The moment I import '@tensorflow/tfjs-node', node just quits out with no error message.

@rswilem
Copy link

rswilem commented Mar 27, 2021

Any update on this issue by any chance? Experiencing the exact same dylib error.

@rodrigolive
Copy link

rodrigolive commented Apr 26, 2021

I've just successfully built and ran my models with tfjs-node 3.5.0 with TensorFlow 2.5.0-rc1 on my M1 Macbook Air. From what I could see, the yet-to-be released TF 2.5.0 is where Apple Silicon is supported, but pre-release 2.5.0-rc1 is already fully usable.

Caveat: I didn't keep exact track of all the steps, this was written in "hindsight" so I maybe I'm missing something.


# 1) set the build directory at will and clone Tensorflow

export BUILDDIR=~/tf-build
mkdir $BUILDDIR && cd $BUILDDIR
git clone -b v2.5.0-rc1 https://github.com/tensorflow/tensorflow tensorflow
cd tensorflow

# 2) you'll need Bazel 3.7.2 to build TF from source
# I've used bazelisk installed with brew under Rosetta
# note that the binaries are built for ARM64 regardless

arch -x86_64 bash
brew install bazelisk

# 3) the following takes a couple hours aprox on my Macbook air
# set the number of jobs to a higher value to speed up the build
# or lower to have it in the background

USE_BAZEL_VERSION=3.7.2 bazel build --jobs 4 --config=macos_arm64 --config=noaws --config=nogcp --config=nohdfs --config=nonccl //tensorflow:libtensorflow.dylib
USE_BAZEL_VERSION=3.7.2 bazel build --jobs 4 --config=macos_arm64 --config=noaws --config=nogcp --config=nohdfs --config=nonccl //tensorflow:libtensorflow_framework.dylib

# 4) now install/bind JS libs with NPM
# I'm assuming you have NVM to manage Node versions
# brew install nvm if you don't have it yet

exit # <---------- we leave the Rosetta bash prompt here
cd $BUILDDIR
mkdir tfjs-test && cd tfjs-test
nvm install 16  # <---- I've actually built with 15.8.0, but it's working under v16 too
npm init -y
npm i node-pre-gyp
npm i @tensorflow/tfjs-node@latest --ignore-scripts
cd node_modules/@tensorflow/tfjs-node/
mkdir -p deps/lib deps/include/tensorflow
cp -r $BUILDDIR/tensorflow/tensorflow/c deps/include/tensorflow/
cp -r $BUILDDIR/tensorflow/tensorflow/core deps/include/tensorflow/
cp -r $BUILDDIR/tensorflow/bazel-bin/tensorflow/*.dylib deps/lib/
npx node-pre-gyp rebuild

That's it.

You should be able to import/require the Tensorflow JS modules and train/predict without issues. I'm still testing this, but so far so good. Training speed is ~5x or faster compared my 2015 Intel i7 Macbook Air and 2-3x compared to a 16 core 4GHz Intel Xeon E5 server.

You can install the @tensorflow/tfjs-node directory by copying it around, repeating the steps or just doing this in a global context (-g, not recommended).

@rthadur
Copy link
Contributor

rthadur commented Apr 26, 2021

Thank you @rodrigolive , @patrickhulce @nickplee can you please confirm if this is resolved on M1 chip with latest release.

@patrickhulce
Copy link

The issue as described is not resolved with @rodrigolive's workaround. Manually hacking @tensorflow/tfjs-node to compile has been workable since tensorflow/tensorflow#45404. Could this issue track working by default? i.e. the @tensorflow/tfjs-node/scripts/install.js script should not throw a fatal error when run on M1, it should download an arm64 compatible binary instead :)

function getPlatformLibtensorflowUri() {
// Exception for mac+gpu user
if (platform === 'darwin') {
system = `cpu-${PLATFORM_MAPPING[platform]}-${ARCH_MAPPING[os.arch()]}`;
}
if (customTFLibUri !== undefined) {
return customTFLibUri;
}
if (platform === 'linux' && os.arch() === 'arm') {
return `${BASE_HOST}tf-builds/libtensorflow_r1_14_linux_arm.tar.gz`;
}
if (ALL_SUPPORTED_COMBINATION.indexOf(system) === -1) {
throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
}

I might be able to take some time next weekend to give a stab at it if no one else has the bandwidth to do so, but closing would be unfortunate as there's still work to be done in this repo.

@rodrigolive
Copy link

Note that I've used a release candidate version. I'd say we still need to wait for TensorFlow 2.5.x to be released, that would be the first GA version to fully support Apple Silicon. Then, yes, we can publish the binary to the storage location and update the install scripts to handle darwin-arm64. As I understand from the Release Notes for 2.5.0-rc1, apparently there aren't any breaking changes that would affect TFJS.

I'm also not sure about the build flags that should be used, --config=macos_arm64 seems to fold the correct configuration options. Here are some build configs in case they actually enable M1 features that could improve performance to make sure we publish a fully optimized M1 lib.

	--config=mkl         	# Build with MKL support.
	--config=mkl_aarch64 	# Build with oneDNN support for Aarch64.
	--config=monolithic  	# Config for mostly static monolithic build.
	--config=numa        	# Build with NUMA support.
	--config=dynamic_kernels	# (Experimental) Build kernels into separate shared objects.
	--config=v2          	# Build TensorFlow 2.x instead of 1.x.

Source: tensorflow/tensorflow#45404

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

@kirillgroshkov
Copy link

These are the steps that worked for me to install unreleased M1-supported version (as I just can't wait for release, need to work on M1 now).

Copy the patch from below to patches dir.

yarn add -D patch-package @mapbox/node-pre-gyp
yarn add @tensorflow/tfjs-node --ignore-scripts
yarn patch-package
cd node_modules/@tensorflow/tfjs-node
yarn add -D @mapbox/node-pre-gyp
node scripts/install.js

@tensorflow+tfjs-node+3.11.0.patch:

diff --git a/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js b/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js
index ac4ae5a..531adeb 100644
--- a/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js
+++ b/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js
@@ -26,7 +26,8 @@ const LIBTENSORFLOW_VERSION = '2.6.0';
 
 /** Map the os.arch() to arch string in a file name */
 const ARCH_MAPPING = {
-  'x64': 'x86_64'
+  'x64': 'x86_64',
+  'arm64': 'arm64'
 };
 /** Map the os.platform() to the platform value in a file name */
 const PLATFORM_MAPPING = {
diff --git a/node_modules/@tensorflow/tfjs-node/scripts/install.js b/node_modules/@tensorflow/tfjs-node/scripts/install.js
index bfa02e3..c65c1de 100644
--- a/node_modules/@tensorflow/tfjs-node/scripts/install.js
+++ b/node_modules/@tensorflow/tfjs-node/scripts/install.js
@@ -88,6 +88,9 @@ function revertAddonName(orig) {
 function getPlatformLibtensorflowUri() {
   // Exception for mac+gpu user
   if (platform === 'darwin') {
+    if (os.arch() === 'arm64') {
+      return `${BASE_HOST}tf-builds/libtensorflow_r2_7_darwin_arm64_cpu.tar.gz`;
+    }
     system = `cpu-${PLATFORM_MAPPING[platform]}-${ARCH_MAPPING[os.arch()]}`;
   }
 

The patch is basically applying this PR on top of last released version: https://github.com/tensorflow/tfjs/pull/5899/files

@fishcharlie
Copy link

@kirillgroshkov Or you know you could just point to the master branch, or the m1_support branch... no need to make it more complicated than it needs to be...

@fishcharlie
Copy link

@pyu10055 Is there any chance we could get an ETA on a release for this tho? Although pointing to the branch directly works fine, I'd love to submit some PRs to some dependencies that use tfjs, and it's highly unlikely PRs will get approved when pointing to a branch.

@pyu10055
Copy link
Collaborator

pyu10055 commented Dec 4, 2021 via email

@kirillgroshkov
Copy link

@kirillgroshkov Or you know you could just point to the master branch, or the m1_support branch... no need to make it more complicated than it needs to be...

Did it work for you, to point to a github branch?

I just checked - the source code is in TypeScript, which needs to be compiled into dist folder (main in package.json points to dist). So, just pointing package.json to git@github.com:tensorflow/tfjs.git won't work, I assume. Also, tfjs-node is in a subfolder (unless you can point to a subfolder, I haven't tried that).

@fishcharlie
Copy link

@kirillgroshkov Ahh, sorry. Pointing it to https://storage.googleapis.com/tfjs-testing/tensorflow-tfjs-node-0.0.0.tgz should work tho (same link as above).

The fact that it's in TypeScript doesn't matter. It'll get built upon install.

@Mrjavaci
Copy link

any update?

@brendon
Copy link

brendon commented Dec 21, 2021

Latest release works :)

@GitHelge
Copy link

GitHelge commented Dec 30, 2021

Im running the new version on my M1. Locally it works fine but when using docker, it runs into this issue:

#10 10.74 npm ERR! code 1
#10 10.74 npm ERR! path /app/node_modules/@tensorflow/tfjs-node
#10 10.75 npm ERR! command failed
#10 10.75 npm ERR! command sh -c node scripts/install.js
#10 10.75 npm ERR! CPU-linux-3.12.0.tar.gz
#10 10.75 npm ERR! * Downloading libtensorflow
#10 10.75 npm ERR! /app/node_modules/@tensorflow/tfjs-node/scripts/install.js:106
#10 10.75 npm ERR!     throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
#10 10.75 npm ERR!           ^
#10 10.75 npm ERR! 
#10 10.75 npm ERR! Error: Unsupported system: cpu-linux-arm64
#10 10.75 npm ERR!     at getPlatformLibtensorflowUri (/app/node_modules/@tensorflow/tfjs-node/scripts/install.js:106:11)
#10 10.75 npm ERR!     at downloadLibtensorflow (/app/node_modules/@tensorflow/tfjs-node/scripts/install.js:139:15)
#10 10.75 npm ERR!     at async run (/app/node_modules/@tensorflow/tfjs-node/scripts/install.js:208:5)
#10 10.76 
#10 10.76 npm ERR! A complete log of this run can be found in:
#10 10.76 npm ERR!     /root/.npm/_logs/2021-12-29T22_14_19_027Z-debug.log

I think the the PR enabled the function for cpu-darwin-arm64 but not for cpu-linux-arm64. Does anyone know if support for linux/arm64 is planned?

@richmengsix
Copy link

Same issue with @GitHelge, would be great if there's a resolution for docker!

@fishcharlie
Copy link

@pyu10055 Do you have any thoughts about this on Docker?

@ozenhaluk
Copy link

ozenhaluk commented Apr 6, 2022

so far no luck with monterey.

tried . tfjs-node 3.15,3.5 & node 14,16 & build my own tensorflow 2.5 & used posted tensorflow 2.7 builds too.
has anyone tried out in monterey ?

But the main reason i am posting is to ask for any idea or even it would be possible to use the instance of Tensorflow on Conda Env. with Metal Plugin (which i already succeded to run GPU based Tensorflow runs) . I think somehow configuring tfjs-node wrapper to use Apple's supported platform will encourage people to use tfjs-node much much more.

@mehimanshupatil
Copy link

for Monterey, tfjs-node is installed, but while running code gives error
zsh: illegal hardware instruction node ./index.js

@Caundy
Copy link

Caundy commented May 9, 2022

for Monterey, tfjs-node is installed, but while running code gives error zsh: illegal hardware instruction node ./index.js

@mehimanshupatil were you able to solve this issue when running Monterey? If so, how? :)

@mehimanshupatil
Copy link

for Monterey, tfjs-node is installed, but while running code gives error zsh: illegal hardware instruction node ./index.js

@mehimanshupatil were you able to solve this issue when running Monterey? If so, how? :)

no, I was not able to solve the issue.

@Caundy
Copy link

Caundy commented May 9, 2022

@mehimanshupatil Sorry to hear, thanks for answering 👍

so far no luck with monterey.

tried . tfjs-node 3.15,3.5 & node 14,16 & build my own tensorflow 2.5 & used posted tensorflow 2.7 builds too. has anyone tried out in monterey ?

@ozenhaluk Did you end up having any success with using tfjs-node on Monterey?

@loretoparisi
Copy link

loretoparisi commented May 12, 2022

Same issues on docker on my platform:

- Platform: Darwin-21.4.0-x86_64-i386-64bit
- Python version: 3.7.8
- Docker version 20.10.14, build a224086

with package.json

{
 "dependencies": {
    "@tensorflow/tfjs-converter": "^2.7.0",
    "@tensorflow/tfjs-core": "^2.7.0",
    "@tensorflow/tfjs-node": "^2.7.0"
  },
}

I get

#31 53.65 npm notice 
#31 53.65 npm ERR! code 1
#31 53.65 npm ERR! path /node_modules/@tensorflow/tfjs-node
#31 53.65 npm ERR! command failed
#31 53.65 npm ERR! command sh -c node scripts/install.js
#31 53.65 npm ERR! CPU-linux-2.8.6.tar.gz
#31 53.65 npm ERR! * Downloading libtensorflow
#31 53.65 npm ERR! /node_modules/@tensorflow/tfjs-node/scripts/install.js:100
#31 53.65 npm ERR!     throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
#31 53.65 npm ERR!           ^
#31 53.65 npm ERR! 
#31 53.65 npm ERR! Error: Unsupported system: cpu-linux-arm64
#31 53.65 npm ERR!     at getPlatformLibtensorflowUri (/node_modules/@tensorflow/tfjs-node/scripts/install.js:100:11)
#31 53.65 npm ERR!     at downloadLibtensorflow (/node_modules/@tensorflow/tfjs-node/scripts/install.js:134:7)
#31 53.65 npm ERR!     at async run (/node_modules/@tensorflow/tfjs-node/scripts/install.js:197:5)
#31 53.66 
#31 53.66 npm ERR! A complete log of this run can be found in:
#31 53.66 npm ERR!     /root/.npm/_logs/2022-05-12T13_57_44_417Z-debug-0.log

@ozenhaluk
Copy link

@mehimanshupatil Sorry to hear, thanks for answering 👍

so far no luck with monterey.
tried . tfjs-node 3.15,3.5 & node 14,16 & build my own tensorflow 2.5 & used posted tensorflow 2.7 builds too. has anyone tried out in monterey ?

@ozenhaluk Did you end up having any success with using tfjs-node on Monterey?

@Caundy no unfortunately

@louismullie
Copy link

Why is this issue closed?

@mohantym
Copy link

Hi @louismullie @ozenhaluk !

I am able to execute above command with latest tfjs-node version in my mac-m1.
Attached screenshot for reference.

Thank you!

@RayBytes
Copy link

RayBytes commented Apr 29, 2023

Has this issue been solved? I'm on MacOS Ventura with a M1 Pro Mac, and I got this error when downloading a lib which used tensorflow:

npm ERR! * Downloading libtensorflow
npm ERR! /Users/username/Desktop/utils/node_modules/@tensorflow/tfjs-node/scripts/install.js:100
npm ERR!     throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
npm ERR!           ^
npm ERR! 
npm ERR! Error: Unsupported system: cpu-darwin-arm64
npm ERR!     at getPlatformLibtensorflowUri (/Users/username/Desktop/utils/node_modules/@tensorflow/tfjs-node/scripts/install.js:100:11)
npm ERR!     at downloadLibtensorflow (/Users/username/Desktop/utils/node_modules/@tensorflow/tfjs-node/scripts/install.js:134:7)
npm ERR!     at async run (/Users/username/Desktop/utils/node_modules/@tensorflow/tfjs-node/scripts/install.js:197:5)

@fishcharlie
Copy link

@RayBytes Has the library you're using updated their dependencies? Definitely not an issue for this project tho. I'd file an issue with that project.

@sgonzalez-pluto
Copy link

sgonzalez-pluto commented Sep 13, 2023

I'm getting a similar error and I'm on MacOS Ventura with an M1 Pro Mac too, this happened to me when running arch -arm64 npm i --legacy-peer-deps or just npm i --legacy-peer-deps.

npm ERR! code 1 npm ERR! path /Users/username/dev/workspace/repo/node_modules/protoc npm ERR! command failed npm ERR! command sh -c node scripts/postinstall.js npm ERR! /Users/username/dev/workspace/repo/node_modules/protoc/scripts/postinstall.js:24 npm ERR! throw new Error(Unsupported platform: ${release}. Was not able to find a proper protoc version.); npm ERR! ^ npm ERR! npm ERR! Error: Unsupported platform: darwin_x86_32. Was not able to find a proper protoc version. npm ERR! at /Users/username/dev/workspace/repo/node_modules/protoc/scripts/postinstall.js:24:11 npm ERR! at Object.<anonymous> (/Users/username/dev/workspace/repo/node_modules/protoc/scripts/postinstall.js:58:3) npm ERR! at Module._compile (node:internal/modules/cjs/loader:1233:14) npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1287:10) npm ERR! at Module.load (node:internal/modules/cjs/loader:1091:32) npm ERR! at Module._load (node:internal/modules/cjs/loader:938:12) npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) npm ERR! at node:internal/main/run_main_module:23:47 npm ERR! npm ERR! Node.js v20.5.1

@mattsoulanille
Copy link
Member

Error: Unsupported platform: darwin_x86_32 - This seems like you may be running in rosetta since it says x86. I'm not entirely sure what could be causing this, but you can try the steps here. Also, make sure you're using a node version that supports Apple Silicon (I think support started at Node 16 or 18). Once you have the correct node and npm binaries, remove your node_modules directory and reinstall. Also, make sure you're using a recent version of tfjs-node

@sgonzalez-pluto
Copy link

Hi @mattsoulanille I was running the terminal without rosetta. I'm using Node 20.5.1.

@mattsoulanille
Copy link
Member

mattsoulanille commented Sep 14, 2023

If you create a new clean npm package and just run npn i @tensorflow/tfjs-node, does it install successfully? Then, can you run node and try the following?

const tf = require('@tensorflow/tfjs-node');
tf.tensor1d([1,2,3]).add(tf.tensor1d([4,5,6])).print();

You should see

Tensor
    [5, 7, 9]

I'm interested in knowing where this process fails. At the install step, the require() step, or the add computation? Thanks!

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

Successfully merging a pull request may close this issue.