Recompling TF Serving
After the CANN software of another version is installed, the tensorflow_model_server service may fail to be started due to a dynamic link library (DLL) link error, as shown in Figure 1.
The following describes the solution.
- Go to the serving-1.15.0/third_party/tf_adapter directory and run the following commands.Copy and save the _tf_adapter.so file in the tf_adapter folder, and change the name of the _tf_adapter.so file to lib_tf_adapter.so.
cp ${TFPLUGIN_INSTALL_PATH}/npu_bridge/_tf_adapter.so . mv _tf_adapter.so lib_tf_adapter.so${TFPLUGIN_INSTALL_PATH} is the installation path of the TF Adapter package.
- Run the following commands to clear the cache of the last compilation to prevent incremental compilation:
rm -rvf /opt/tf_serving bazel clean
- Compile TF Serving.
Run the following command in the TF Serving installation directory serving-1.15.0 to compile TF Serving:
bazel --output_user_root=/opt/tf_serving build -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" tensorflow_serving/model_servers:tensorflow_model_server
The --output_user_root option specifies the installation path of TF Serving. Set it based on the actual situation.
Parent topic: Sample Reference
