diff --git a/CMakeLists.txt b/CMakeLists.txt index f40f0dcf1..937b06c00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,7 @@ else () COMMAND mkdir ARGS -p ${CMAKE_BINARY_DIR}/server/plugins COMMAND ln ARGS -sf ${CMAKE_BINARY_DIR}/sdk/examples/order_plugin_example.so ${CMAKE_BINARY_DIR}/server/plugins/ COMMAND ln ARGS -sf ${CMAKE_BINARY_DIR}/sdk/examples/ai_order_plugin_example.so ${CMAKE_BINARY_DIR}/server/plugins/ + COMMAND ln ARGS -sf ${EXTERNALS_ROOT}/lib/Release/libtensorflow_cc.so ${CMAKE_BINARY_DIR}/server COMMENT "Creating server runtime layout" DEPENDS sparkd data_files_dir) diff --git a/src/sdk/examples/ai_order_plugin_example.cpp b/src/sdk/examples/ai_order_plugin_example.cpp index 73544d429..2fffd05d6 100644 --- a/src/sdk/examples/ai_order_plugin_example.cpp +++ b/src/sdk/examples/ai_order_plugin_example.cpp @@ -1,5 +1,6 @@ #include "../tensorflow/tfloader.h" #include "../tensorflow/tfexecute.h" +#include "tensorflow/cc/saved_model/loader.h" #undef LOG #include "spark/lib/logging/logging.h" @@ -78,6 +79,12 @@ void AISampleOrder::on_init_new( api::orderman::OrderDefinition const &def, const PreActivationOrderServices &services) { + { + std::unordered_set tags; + tensorflow::SavedModelBundle bundle; + bts::ml::load_tf_model("", tags, &bundle); + } + me->def = def; me->state.mutable_dynamic(); diff --git a/src/sdk/examples/build_examples.sh b/src/sdk/examples/build_examples.sh index 1c2a4a415..4c646a0a8 100755 --- a/src/sdk/examples/build_examples.sh +++ b/src/sdk/examples/build_examples.sh @@ -11,7 +11,6 @@ g++ -isystem ../externals/include \ -l spark \ -llttng-ust \ -ldl - g++ -isystem ../externals/include \ -I ../include \ @@ -43,12 +42,6 @@ g++ -isystem ../externals/include \ -Wl,-rpath,.. \ -Wl,-rpath,../lib \ -L ../lib \ - -l spark \ - -L ../externals/lib \ - -l tensorflow_cc - -if [ -f "../../server/libtensorflow_cc.so" ]; then - rm ../../server/libtensorflow_cc.so -fi -ln -s ../../../externals/linux/lib/Release/libtensorflow_cc.so ../../server/ + -l tensorflow_cc \ + -l spark