Skip to content

Troubleshooting & FAQ

Memo Akten edited this page May 20, 2017 · 2 revisions

Common tensorflow installation problems can be found on the tensorflow website. Below are some other known issues or common gotchas relating to the addon.


libstdc++.so.6: version `GLIBCXX_3.4.20' not found

Application compiles and links fine, but exits on startup with errors similar to the above.

try sudo apt-get install libstdc++6, or conda install libgcc if you use anaconda.


Jpegs don't load

This may be unique to my system, but jpegs don't load for some reason! ofImage.load doesn't work with jpegs. FreeImage_Load fails. Neither does cvLoadImage (or cv::imread). If I don't use tensorflow, it works. If I use tensorflow, it doesn't. Just fails silently. Needs serious investigation. PNGs work fine. Also see https://github.com/tensorflow/tensorflow/issues/1924


No system dialogs

Whatever it is that implements ofSystemDialog, was compiled with protobuf 2.6.1 whereas tensorflow needs protobuf>3.2.0. So I can't use ofSystemDialogs. Also needs investigation.


X.h #defines

This isn't really a question or a major problem, but a note. I had to #undef a bunch of special names that were #defined in X.h, such as Success, Status, None, Complex, BadColor etc. They were all #defined as ints and was preventing tensorflow from compiling. I don't know if this has any side effects.


Does the version of tensorflow that I have installed in python (e.g. via pip) need to match the version of tensorflow that I use in ofxMSATensorFlow?

Strongly recommended, but not essential. When you install the tensorflow python package (e.g. via pip), its binaries and headers will live somewhere inside your python distribution (typically in a folder called site-packages). This is completely independent to the tensorflow library and headers used by ofxMSATensorFlow (which will typically be inside [your_openframeworks_folder]/addons/ofxMSATensorFlow/libs/tensorflow). So the two can be different, and if you use python tensorflow independently to C++/openframeworks/ofxMSATensorFlow then there should be no problem. However, if you plan on building and training models in python, saving them out and loading the pretrained models in openframeworks with ofxMSATensorFlow, then it's highly recommended that the versions do match, to avoid incompatibilities between file formats, operators etc.


Debug vs Release. Random crashes when running the application

If you mismatch the libtensorflow_cc.so library build mode with the app build mode (i.e. building your app in debug while the library is optimised or vice versa) sometimes this causes a crash (segmentation fault). The same application might work with no problems when you match debug lib to debug app and release lib to release app. This doesn't happen with all operations, just some (I think it's the cc ops, needs more debugging). So if your app is constantly crashing and you're not sure why, check the debug/release settings vs the lib.

Currently I'm not sure how to manage both release and debug libraries simultaneously in the project with the custom of.qbs template we're using. Usually you'd place both libraries in the system and let the linker choose with -ltensorflow under release configuration options and -ltensorflowd under debug configuration options. But I couldn't find that in the way the openframeworks qbs template is setup. So for now I manually copy over one or the other :S Needs investigation.

Update: The above was an issue with TF0.7, but now the difference in filesize between optimised and non-optimised lib is less than 1MB, so I'm not sure if this is still relevant.


Eigen3

Tensorflow uses Eigen in the backend for Tensor stuff. So feel free to use it. It's included in the addon. (And don't include Eigen3 in your project separately)