Addon not correctly imported (QtCreator + Ubuntu)

Hey everyone,

Not sure if this is a general issue that should be here or if I should ask it on the addon’s github, so sorry if I’m at the wrong place. I’m trying to use @memo’s TensorFlow addon on linux, but I’m facing a weird issue. As the screenshot below shows, the addon seems to be correctly imported, with all its files appearing in the project’s tree. But nevertheless, the #include statement tells me that it’s unable to find the header file.

I tried adding the addon path to the include paths, but it didn’t make any difference. Any ideas on what may be going on there? Using QtCreatror 4.2.1, oF 0.9.8 and Ubuntu 16.04.

Thanks in advance

Hey Velenoise, this actually does look like a generic issue, and I’m not sure why it might be happening. I’ll investigate on my end.

Though I should say, that even if you get around this problem, it’s quite likely that the addon will not work, as I last updated it to work with Tensorflow v0.7, and the current version is v1.0. And with every version (0.7, 0.8, 0.9, 0.10, 0.11, 0.12 etc) it needs rebuilding and re-jigging of a bunch of header files (I have a version working with 0.9, but I didn’t get round to cleaning the headers and pushing). I’m hoping to upload a version compatible with TF 1.0 this month. Sorry about that!

@memo Thanks for the heads up! I actually rebuilt the library file for cuda 8.0 and CuDNN 5.1.5, and was expecting to have to copy the headers as you explain on the readme file. But getting it stopped even sooner when QtCreator couldn’t load the addon’s header file was a big surprise for me. I even added the ofxDatGUI addon included just for test purposes, to check wheter it was a specific issue with this addon or a more general problem, but the ofxDatGUI classes are imported just as expected. =/

if you try to compile does it work? it would seem that’s just the static analizer not finding the header but the compiler might work, also if you set up the clang static analizer instead of the default in qtcreator it’s much more accurate although usually slower

@arturo No, it’s not locating the file when compiling as well

this is very weird, no idea why it is! Could it be a filesystem issue somehow?

@memo not sure, but I don’t think so. It’s a freshly formatted machine, and also I believe that a filesystem issue would probably affect the other addon, wouldn’t it? Any idea of how I could test this possibility?

i’m testing it and it works fine for me,i’m getting other errors later when linking but the headers are found ok. I think, from the path, that your project is not in openFrameworks/apps/something/project. that’s 3 levels below OF which should work but it might be that for some reason it doesn’t with this addon, probably something to do with the addon_config parsing or something like that. can you try to move the project to that kind of path?

@arturo thanks for the update. Yep, putting it on the myApps directory still makes the IDE not find the files, but on compilation it works. Now it’s just a matter of investigating why this specific addon is not working when linked from another directory. Was there any specific change to the addon_config to allow projects to work from different directories?

New funny thing: when switching to clang code model, it not only shows that the file is not found on edit mode, but also on compilation!

Default model:

Clang model:

Ok, so simply removing the addon_config file made Qt find the classes correctly, both on IDE and compilation, even outside of myApps directory. Now I’m getting this bunch of template with C linkage errors, but I believe that’s related to the updates @memo mentioned.

Thanks a lot for the insights guys!

without the addon_config.mk it won’t be able to include the libraries properly. i think there’s a bug when using a addon with addon_config outside of the apps folder but i think you really need it to use this addon, otherwise the include search paths won’t be correct. when i tried it yesterday it was compiling without errors there was only some linking errors

I see. That’s a bigger problem then, I’ll have to dig deeper later on the errors I got when compiling from inside the myApps folder. Thanks!

hey FYI I just tried with QTCreator 4.2.1 and I’m getting the same problem. I tried running the basic example that’s inside the ofxMSATensorFlow folder, and it can’t find ofxMSATensorFlow.h. I also tried just adding it to the emptyExample (inside myApps) and again same problem. I’m not sure why it’s happening. Is this new to QTCreator 4.2.1? I’m pretty sure it used to work with 4.1 (which is what I had before).

Talking about 4.2.1: is it working fine? It seems like opening cpp/h files grabs ram that is not released after closing them. I have to restart qtcreator regularly to get the ram back before the whole computer becomes slow an unusable. I’m on ArchLinux with 8gb.

Good thing is that I show the free ram in the info bar. When it reaches 0.3Gib, I restart qtcreator and it goes back to 5Gib. I did not notice this behavior earlier.

can you try if using the nighlty builds solves the problem? it works for me fine with latest master

Hey, I’m revisiting this problem. I’m on QT Creator 4.1 now and I’m still having the problem that when I have addon_config.mk it can’t find any headers, including ofxMSATensorFlow.h!

Specifically, if I have the following lines enabled, it can’t find any headers

   ADDON_INCLUDES = src
   ADDON_INCLUDES += libs/tensorflow/include
   ADDON_INCLUDES += libs/tensorflow/include/third_party/eigen3
   ADDON_INCLUDES += libs/tensorflow/include/external/eigen_archive
   ADDON_INCLUDES += libs/tensorflow/include/external/eigen_archive/eigen-eigen-70505a059011

If I disable just the first line, then it works (i.e. can find headers, I still run into the template error but that’s something else). And this definitely did used to work before!

This is leading me to believe that maybe the relative folder isn’t working, i.e. overriding ADDON_INCLUDES = src. Could it be that the qbs parser has changed?

I’'m on Ubuntu 16.04 now btw, but I used to be on 14.04. I don’t know if that will affect this somehow.

P.S. I need to do the above (override and equate to src, and then manually add a few folders) because otherwise recursively all subfolders are added to the include path, and annoyingly there is a time.h in there somewhere, which gets included by accident from ofMain.h, causing all the template errors.

I think I’ve found a work around (by not having time.h etc inside the google protobuf headers). I’m updating the addon to use tensorflow r1.0, there is an awful lot to fix :S but hopefully I’ll be able to push it soon.

Hey @memo, thanks for the heads up! Unfortunately I hadn’t been able to dig deeper into it these last weeks, but it’s good to know that you were able to find a way. Looking forward to your new release.

Hey, actually I just pushed it earlier today. TF1.0, all the examples including inception etc works. Though for me jpgs still don’t work (fail silently) and system dialogs cause it to crash at startup. I’m pretty sure the latter at least is due to protobuf.

I changed the way get_top scores works. It was very inefficient before, constructing a graph and then running the graph, every frame! I just do it on cpu now.

So now the addon.mk doesn’t have any header search paths (so they’re all recursively added), @arturo it would be good to figure out why it doesn’t work when I just say src.