Tensorflow on Arm with "No session factory registered" Error

2

I cross compiled the tensorflow-on-arm code (https://github.com/lhelontra/tensorflow-on-arm) using the rpi configuration. I could link a test program against the generated libtensorflow.so and libtensorflow_frame.so like this:

sources/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -g -std=gnu++11 -Wall -W -fPIC -I. -I./sources/tensorflow -I./build/execroot/org_tensorflow/bazel-out/armeabi-opt/genfiles -I./build/external/com_google_absl -I./build/external/eigen_archive/ -I./build/external/protobuf_archive/src -Wl,--allow-multiple-definition -Wl,--whole-archive -o main.o ./main.cpp

and

sources/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o test_tf main.o -L/build_tensorflow/build/tensorflow_pkg -ltensorflow -ltensorflow_framework

However, after I deployed my test code to an Arm target and run it, I got the following error:

2019-09-18 21:56:29.284394: E tensorflow/core/common_runtime/session.cc:60]
Not found: No session factory registered for the given session options:
{target: "" config: } Registered factories are {}.

I found a similar question for the IOS platform. But both, my host (Debian Stretch) and target (Ubuntu) systems, are Linux.

How should I go about to fix the issue?

hr8799

Posted 2019-09-19T14:40:39.770

Reputation: 21

I do have the same issue when building natively on the Jetson Nano. I tried gcc 7 and 5.5 and 7.4. I can't build tensorflow on the Nano because of some error (but I didn't try J__T solution here https://devtalk.nvidia.com/default/topic/1058253/jetson-nano/request-for-prebuilt-tensorflow-c-c-api-libs-for-jetson-nano/post/5374862/#5374862). I've download the one here https://github.com/jens-totemic/tensorflow/releases/tag/v1.13.1 and also tried the one shipped with python module. Did you find a solution on your side ?

– antoine – 2019-10-15T22:07:14.863

Finally I got it working and get rid of the annoying "No session factory registered for the given session options" error by following the step-by-step tutorial here : https://devtalk.nvidia.com/default/topic/1055131/jetson-agx-xavier/building-tensorflow-1-13-on-jetson-xavier/ I just have to add a CPU limiter to avoid my Nano to restart sporadically (well, I was building through SSH, I didn't have full control over the device all the day, that may have delayed the success a little bit...). I add --local_resources 8000,3,1.0 option to bazel build to limit RAM usage to 8Go, and CPU cores to 3

– antoine – 2019-10-17T21:14:36.293

No answers