#从公司生产环境镜像源下载docker镜像
docker pull abc.s.test-inc.com/container/tensorflow/serving :1.12.0
#下载serving源码,docker镜像运行的时候,需要使用里面的模型文件进行测试
git clone -b r1.12 --recurse-submodules https: //github .com /tensorflow/serving
#启动tensorflow-serving
/usr/bin/docker run -it -p 8501:8501 - v "/opt/tensorflow-serving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu:/models/half_plus_two" -e MODEL_NAME=half_plus_two -d abc.s.test-inc.com/container/tensorflow/serving :1.12.0
#测试模型
/usr/bin/curl -d '{"instances": [1.0, 2.0, 5.0]}' -X POST http: //localhost :8501 /v1/models/half_plus_two :predict
|