Tensorflow Serving实战 使用config文件serving模型(三)

开发环境

  • Ubuntu 18.x
  • Docker 18.x
  • Tensorflow 1.x

文件目录

├── models                                        //模型与config文件存放的目录
│   ├── models.config                             //配置文件 
│   ├── saved_model_half_plus_two_cpu             //模型文件 
│   │   ├──1538687457                             //版本号
│   │   │   ├── saved_model.pb                
│   │   │   ├── variables
│   │   │   │   ├── variables.data-00000-of-00001           
│   │   │   │   ├── variables.index                                        
│   ├── super-resolution                          //模型文件,目录格式跟上面这个模型一样 
│   ├── resnet                                    //模型文件 

配置文件内容

model_config_list {
  config {
    name: "resnet",
    base_path: "/models/resnet"
    model_platform: "tensorflow"
  }
  config {
    name: "half_plus_two",
    base_path: "/models/saved_model_half_plus_two_cpu"
    model_platform: "tensorflow"
  }
  config {
    name: "super-resolution",
    base_path: "/models/super-resolution"
    model_platform: "tensorflow"
  }
}

serving命令

docker run -p 8500:8500 -p 8501:8501 \
 --mount type=bind,source=/cmq/models/resnet/,target=/models/resnet \
 --mount type=bind,source=/cmq/models/saved_model_half_plus_two_cpu/,target=/models/saved_model_half_plus_two_cpu \
 --mount type=bind,source=/cmq/models/super-resolution/,target=/models/super-resolution \
 --mount type=bind,source=/cmq/models/models.config,target=/models/models.config \
 -t tensorflow/serving --model_config_file=/models/models.config

注意:mount 命令需要高版本的docker,如果是执行时报找不到命名mount命令的错,多半是你的docker版本低了,source 参数后面是绝对路径,逗号后面的不能有空格。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值