GithubHelp home page GithubHelp logo

Comments (7)

FloopCZ avatar FloopCZ commented on June 26, 2024

Hi, this behavior is strange, but I don't really know what is wrong. Fortunately, you don't need to use NDEBUG macro, since tensorflow is already configured for optimized build here.

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Sorry, you are talking about the example CMakeLists, not the tensorflow_cc CMakeLists. That may cause some issues. Can you please try to build the example with -DCMAKE_BUILD_TYPE=Release and tell me whether it produces the same error?

from tensorflow_cc.

achalshah20 avatar achalshah20 commented on June 26, 2024

Thanks!

So, I did following steps

cd example  

mkdir build  

cd build  

cmake -DCMAKE_BUILD_TYPE=Release  

make -j  

Then I did "ldd example" and I couldn't find the libtensorflow_cc.so file but it can find libtensorflow_framework.so. Moreover, the same error if I execute ./example.

"No session factory registered for the given session options: {target: "" config: } Registered factories are {}."

I am not able to understand how -DNDEBUG flag affects the library linking part!?

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Hi, thank you. I was looking into it, but unfortunately, I have not been able to solve it.

Tensorflow uses global register objects. I believe the problem is that without the NDEBUG symbol, the global register objects that appear to be unused get optimized out by the compiler. Unfortunately, I have no idea how to avoid it.

Does anyone have a suggestion?

Relevant issues: tensorflow/tensorflow#3308 tensorflow/tensorflow#6396 tensorflow/tensorflow#4242

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

@achalshah20 It appears that monolithic build solves the issue, can you please try #64, whether it helps you as well?

from tensorflow_cc.

achalshah20 avatar achalshah20 commented on June 26, 2024

Hi @FloopCZ , Yes it works. Thanks for the fix!
I am still wondering what monolithic build has to do with debug flags?

from tensorflow_cc.

FloopCZ avatar FloopCZ commented on June 26, 2024

Monolithic build merges all the libraries into a single library libtensorflow_cc.so (i.e., no extra libtensorflow_framework.so). This single library has to be linked, so we avoid optimizing out the global registers. It is a little bit hacky, though. :-)

from tensorflow_cc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.