Skip to content

TensorFlow Serving API

David Salek edited this page Nov 14, 2017 · 14 revisions

In order to run the client code of TensorFlow Serving, install the python API.

sudo pip install tensorflow-serving-api

The installation will fail with the error below in case you do not have gcc version 4.9.

c++: error: unrecognized command line option ‘-fstack-protector-strong’

This is the way to get version 4.9 of the gcc compiler:

sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 1 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
sudo update-alternatives --config gcc

Query the service using the external IP address:

wget https://github.com/salekd/rpizero_smart_camera/raw/master/camera.JPG
python tensorflow_serving/example/inception_client.py --server=192.168.2.2:9000 --image=/path/to/my_cat_image.jpg
Clone this wiki locally