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

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.

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.

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

Related

Could not find a declaration file for module '#hmscore/react-native-hms-push'

I'm having problems with linking push kit library.
I'm programming in react-native with visual studio code, library '#hmscore/react-native-hms-push' not seem to be imported correctly, the error is 'Could not find a declaration file for module '#hmscore/react-native-hms-push'.
I'm using 5.3.0-301 version.
Checking maps-kit and push-kit seems different si index.ts, is missing in the src directory of push-kit
i have used this guide:
https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/integraternmodule-0000001050157791
have i missed anything?
Thanks
The solution is:
yarn add #types/hmscore__react-native-hms-push
or equivalent in npm.

Incomplete python source distrubtion when building Fortran/Numpy extension

When building a source distribution of a Python package that contains a Fortran/Numpy Extension, the source distribution is incomplete. It lacks the source files fortranobject.c and fortranobject.h, which are copied by numpy's own setup function when you do a binary build (bdist), or a local install. However, if you do a source build (sdist), these files are not packaged. As a result, the source distribution cannot be used to locally build a binary wheel, hence a local install also fails.
Originally, I reported this as a bug in pypa/build (see: https://github.com/pypa/build/issues/326). However, I think the problem is with numpy, and not with pypa/build, because the same problem arises when you do a traditional python setup.py build_ext sdist to build a source distribution.
Does anyone know how to solve this issue?
OK, I finally tracked down the issue, which I think is a bug in how Extension in Numpy's distutils handles pyf source files. Here's the bug report: https://github.com/numpy/numpy/issues/19441.

VS Code + CMake : cmake.build not found

I have CMake working perfectly fine with Visual Studio 2015. I wanted to try VS Code with C++ and CMake extensions, but when I try to call the build command (configured to F7 by default with the CMake extension for VSCode), I only get the message:
command 'cmake.build' not found
Is it trying to tell me it can't find CMake ? Because Cmake is installed and working so... I also tried changing in the settings to the full path to cmake with no success. I installed both CMake and CMake Tools from Extensions. Also the toolbar for CMake doesn't appear on the blue VSCode toolbar as shown in CMake Tools extension doc.
Edit:
The author of that extension believes they've resolved this issue in the latest version 0.9.7.
https://github.com/vector-of-bool/vscode-cmake-tools/issues/157#issuecomment-307005140
So, I've just pushed 0.9.7:
No more dependency on twxs.cmake, so that shouldn't be causing any
issues anymore
#ytimenkov fixed some version parsing code that was
lying about what version of CMake was installed. Should fix issues
people are seeing with pre-3.7 versions.
#ytimenkov added better
errors when initialization failed. This should help create future
tickets!
As such, I'm going to close this issue and ask that anyone
with any further issues open a new ticket using the new error messages
that appear during a failed initialization.
I too had this issue and was given a solution here in my ticket.
For some people, one of their dependencies isn't getting installed correctly on our system. So you need to install another additional extension to get it to work.
It's called "CMake" or "twxs.cmake" (actual package name) and can be found here: https://marketplace.visualstudio.com/items?itemName=twxs.cmake
If it still isn't working, some have reported that they needed to uninstall both extensions then reinstall them both to get it to work--making sure to restart VSCode.
try this:
create a new copy of "mingw32-make.exe".
rename the copy to "make.exe".
restart your vscode.

Compiling caffe

I'm trying to compile caffe using cmake on a Linux machine. I get this complaint when running cmake:
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "2.7")
I later get this error
CMake Error at CMakeLists.txt:85 (add_dependencies):
The dependency target "pycaffe" of target "pytest" does not exist.
What am I doing wrong? I tried setting an environment variable for PYTHON_LIBRARIES but that didn't help. I'm using my locally installed version of python (2.7.13), so I think that might be causing the problem, but I don't know how to get past this.
I was able to "fix it" by editing the file build/CMakeCache.txt and manually setting these
PYTHON_INCLUDE_DIR
PYTHON_LIBRARY
I don't know if that's the correct way to resolve this. If not, what is the right way to resolve this?
I had the same error while installing caffe on Ubuntu 14.04; I solved this by installing boost-python:
sudo apt-get install libboost-python-dev
Check carefully through the installation instructions. There's a variety of dependencies to install (python-devel, glog-devel, ...) and some environment variables to set. Using a local Python installation isn't a problem, as long as you have that properly in your paths. Remember to check your PATH and LD_LIBRARY_PATH variables as well.
You might check with
env | egrep -i "py"
to see what variables do have Python references. If you suspect a version problem with an executable, use
ldd <executable>
To see what objects and versions get loaded. Among other things, it's vaguely possible that something got compiled against an older Python in the system directories.
You need to install numpy
Try pip install numpy

How to use browserify standalone option

I'm trying to create a standalone library that can be used as global variable, amd or commonjs module.
But after compiling it with browserify with standalone option, I can't include it in a next build as a compiled library because of the browserify error
Error: Cannot find module './dependency'
How to handle this problem.
All source code that i use can be found here: https://github.com/paveltyavin/double-browserify
Ok, the problem described in this github issue and in this question.
TLDR: use derequire.
Browserify parses compiled code and tries to make bundle everytime it reads function require . Minification (uglify) can be a nice workaround to handle the problem.