Tensorflow Serving

安装

$ sudo docker pull tensorflow/serving

Using default tag: latest
latest: Pulling from tensorflow/serving
d5×××××××××76: Pull complete 
d2×××××××××9c: Pull complete 
b3×××××××××0b: Pull complete 
cd×××××××××73: Pull complete 
79×××××××××8c: Pull complete 
9d×××××××××e8: Pull complete 
0f×××××××××d9: Pull complete 
Digest: ×××××××××:******
Status: Downloaded newer image for tensorflow/serving:latest
$ sudo docker imag
es
REPOSITORY              TAG                     IMAGE ID            CREATED             SIZE
tensorflow/serving      latest                  78×××××××××a4        7 weeks ago         298MB

测试:

$ curl http://localhost:8501/v1/models/xception
{
 "model_version_status": [
  {
   "version": "1",
   "state": "AVAILABLE",
   "status": {
    "error_code": "OK",
    "error_message": ""
   }
  }
 ]
}
$ curl http://loca
lhost:8501/v1/models/xception/metadata
{
"model_spec":{
 "name": "xception",
 "signature_name": "",
 "version": "1"
}
,
"metadata": {"signature_def": {
 "signature_def": {
  "serving_default": {
   "inputs": {
    "inputs": {
     "dtype": "DT_FLOAT",
     "tensor_shape": {
      "dim": [
       {
        "size": "-1",
        "name": ""
       },
       {
        "size": "2",
        "name": ""
       }
      ],
      "unknown_rank": false
     },
     "name": "serving_default_inputs:0"
    }
   },
   "outputs": {
    "outputs": {
     "dtype": "DT_FLOAT",
     "tensor_shape": {
      "dim": [
       {
        "size": "-1",
        "name": ""
       },
       {
        "size": "1",
        "name": ""
       }
      ],
      "unknown_rank": false
     },
     "name": "StatefulPartitionedCall:0"
    }
   },
   "method_name": "tensorflow/serving/predict"
  },
  "__saved_model_init_op": {
   "inputs": {},
   "outputs": {
    "__saved_model_init_op": {
     "dtype": "DT_INVALID",
     "tensor_shape": {
      "dim": [],
      "unknown_rank": true
     },
     "name": "NoOp"
    }
   },
   "method_name": ""
  }
 }
}
}
}
$ curl -d '{"insta
nces": [1.0, 2.0, 5.0]}' -X POST http://localhost:8501/v1/models/xception:predict
{
    "error": "In[0] is not a matrix. Instead it has shape [3]\n\t [[{{node functional_1/outputs/BiasAdd}}]]"
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值