memo / ofxMSATensorFlow

C++ openframeworks addon and examples integrating Google's TensorFlow numerical computation and machine learning library
Apache License 2.0
456 stars 87 forks source link

basic-example fails in linking with tensorflow r1.3 CPU mode #40

Closed federicohyo closed 5 years ago

federicohyo commented 5 years ago

After compiling libtensorflow_cc.so and libtensorflow_framework.so from source - version r1.3 - with only CPU mode , I cannot compile any example as I get the following error..

setup: ubuntu 18.04, ofx_v0.10.1, tensorflow 1.3, ofxMSATensorflow from master..

do you know any workaround for this?

any help is appreciated.

federico@zappatorevm:~/imec-nl/of_v0.10.1_linux64gcc6_release/addons/ofxMSATensorFlow/example-basic$ make -j 4 HOST_OS=Linux checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 with PKG_CONFIG_LIBDIR= Compiling OF library for Release make[1]: Entering directory '/home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/openFrameworksCompiled/project' HOST_OS=Linux checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 with PKG_CONFIG_LIBDIR= HOST_OS=Linux checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 with PKG_CONFIG_LIBDIR= HOST_OS=Linux checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 with PKG_CONFIG_LIBDIR= Done! make[1]: Leaving directory '/home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/openFrameworksCompiled/project'

Compiling example-basic for Release make[1]: Entering directory '/home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/ofxMSATensorFlow/example-basic' HOST_OS=Linux checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 with PKG_CONFIG_LIBDIR= Linking bin/example-basic for linux64 g++ -o bin/example-basic obj/linux64/Release/src/example-basic.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSAMathUtils.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFVizUtils.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFImageClassifier.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFLayerVisualizer.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFUtils.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFSimpleModel.o /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/ofxMSATensorFlow/libs/tensorflow/lib/linux64/libtensorflow_framework.so /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/ofxMSATensorFlow/libs/tensorflow/lib/linux64/libtensorflow_cc.so -Wl,-rpath=./libs:./bin/libs -Wl,--as-needed -Wl,--gc-sections -fuse-ld=gold -L/home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/fmodex/lib/linux64/ -lfmodex ../libs/tensorflow/lib/linux64/libtensorflow_cc.so -ltensorflow_cc ../libs/tensorflow/lib/linux64/libtensorflow_framework.so -ltensorflow_framework /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/kiss/lib/linux64/libkiss.a /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/tess2/lib/linux64/libtess2.a -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lcurl -lglfw -lrtaudio -lpulse-simple -lpulse -lasound -lGLEW -lGLU -lGL -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmpg123 -lglut -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -ldl -lpthread -lfreeimage -lboost_filesystem -lboost_system -lpugixml -luriparser -lXinerama obj/linux64/Release/src/example-basic.o:example-basic.cpp:function ofApp::draw(): error: undefined reference to 'tensorflow::Tensor::DebugString[abi:cxx11]() const' obj/linux64/Release/src/example-basic.o:example-basic.cpp:function ofApp::draw(): error: undefined reference to 'tensorflow::Tensor::DebugString[abi:cxx11]() const' obj/linux64/Release/src/example-basic.o:example-basic.cpp:function ofApp::draw(): error: undefined reference to 'tensorflow::Tensor::DebugString[abi:cxx11]() const' /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFUtils.o:ofxMSATFUtils.cpp:function msa::tf::session_gpu_options(bool, double, tensorflow::SessionOptions const&): error: undefined reference to 'tensorflow::ConfigProto::_slow_mutable_gpu_options()' /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/obj/linux64/Release/ofxMSATensorFlow/src/ofxMSATFUtils.o:ofxMSATFUtils.cpp:function void google::protobuf::Arena::Own<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(std::cxx11::basic_string<char, std::char_traits, std::allocator >): error: undefined reference to 'google::protobuf::Arena::AddListNode(void, void ()(void))' collect2: error: ld returned 1 exit status /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:403: recipe for target 'bin/example-basic' failed make[1]: [bin/example-basic] Error 1 make[1]: Leaving directory '/home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/addons/ofxMSATensorFlow/example-basic' /home/federico/imec-nl/of_v0.10.1_linux64gcc6_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:124: recipe for target 'Release' failed make: [Release] Error 2

federicohyo commented 5 years ago

closing this issues as it can be easily solved by commenting gpu settings line (59-60) in ofxMSATFUtils.cpp and by installing required version of protobuf compatible with tf r1.3.

thanks for sharing!

memo commented 5 years ago

Oh glad you sorted this out. Unfortunately I haven't had time to look at this in a while :/ (but I do remember often running into problems with protobuf)