TensorFlow Serving is a flexible, high-performance serving system for machine learning models, designed for production environments.
docker pull tensorflow/serving
网络原因,可能会导致timeout,多尝试几次。
git clone https://github.com/tensorflow/serving
docker run -t --rm -p 8501:8501 \
-v "/root/tf-serving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu:/models/half_plus_two" \
-e MODEL_NAME=half_plus_two \
tensorflow/serving &_model_half_plus_two_cpu:/models/half_plus_two" \
-e MODEL_NAME=half_plus_two \
tensorflow/serving &
启动后。。。
curl -d '{"instances": [1.0, 2.0, 5.0]}' \
-X POST http://localhost:8501/v1/models/half_plus_two:predict
测试成功。。。
No versions of servable half_plus_two found under base path /models/half_plus_two
创建目录:/models/half_plus_two