thammada.ts
thammada.ts

Reputation: 5245

How to use tfjs-node with libtensorflow that is built from source

I see that it is possible to use libtensorflow that is built from source, as mentioned in the README https://github.com/tensorflow/tfjs-node#optional-build-libtensorflow-from-tensorflow-source

I have successfully built from source, but I don't know how to let tfjs-node use this custom built version, instead of the pre-built one.

Upvotes: 2

Views: 646

Answers (2)

Mechanic
Mechanic

Reputation: 5380

I'd manually re installed the libtensorflow c and it resolved the issue:

follow the instructions here: https://www.tensorflow.org/install/lang_c#setup

Upvotes: 0

thammada.ts
thammada.ts

Reputation: 5245

I found that the following workaround seems to work:

Copy the file bazel-bin/tensorflow/libtensorflow.so from the tensorflow source directory to replace node_modules/@tensorflow/tfjs-node/deps/lib/libtensorflow.so inside your project.

Hopefully there is a better way to do npm install such that there is no need to download the pre-compiled version.

Upvotes: 2

Related Questions