0
votes

I am new to TensorFlow (using 1.13) and trying to build a TF model and serve it on a docker tensor flow model server. I have exported my model, installed docker and started my docker container with the command:

docker run -p 8501:8501 --name SN_TFlow
--mount type=bind,source=/tmp/service_model/export,target=/models
-e MODEL_NAME=1596551653 -t tensorflow/serving &

I can see my container running and the line: "I tensorflow_serving/model_servers/server.cc:375] Exporting HTTP/REST API at:localhost:8501 ..." in the client which seems to indicate all is up and running according to the doc.

Docker log view

However when I try to test my model with the curl command: $ curl -d ‘{"test_value": [40]}' \ -X POST http://localhost:8501/1/models/1596551653:predict

I get a message saying: URL bad/illegal format or missing url Could not resolve host POST and I get a 404 message.

enter image description here I also tried simply curl http://localhost:8501/models/1/1596551653 but also get Not found. Any idea what I am missing? Thanks

1

1 Answers

0
votes

The problem I observe in your code is the \ in the middle of the curl command.

The backslash, \ should occur at the end of the line, if the command is more than one line.

So, the below command,

$ curl -d ‘{"test_value": [40]}' \ -X POST

http://localhost:8501/1/models/1596551653:predict

should be changed as shown below (move the backslash to the end) :

$ curl -d ‘{"test_value": [40]}' -X POST \

http://localhost:8501/1/models/1596551653:predict

Also, we suggest you to upgrade to the Latest Version of Tensorflow in 1.x, which is 1.15 or to 2.3.0.