如何用 tensorflow serving 部署服务
第一步,读一读这篇博客
https://www.jb51.net/article/138932.htm (浅谈Tensorflow模型的保存与恢复加载)
第二步:
参考博客:
- https://blog.csdn.net/u011734144/article/details/82107610
按照上述教程配置好相关文件之后(模型是下面tensorflow-serving中产生的,直接移到textcnnrnn中的)然后再执行下面命令:
首先启动:
ljj@debian:~$ docker run -p 8501:8501 --mount type=bind,source=/home/ljj/serving/tensorflow_serving/servables/tensorflow/testdata/textcnnrnn,target=/models/find_lemma_category -e MODEL_NAME=find_lemma_category -t tensorflow/serving
然后调用:
ljj@debian:~$ curl --tlsv1.2 -d '{"instances": [10,10,10,8,6,1,8,9,1]}' -X POST http://0.0.0.0:8501/v1/models/find_lemma_category:predict
但是出现错误:
{ "error": "instances is a plain list, but expecting list of objects as multiple input tensors required as per tensorinfo_map" }ljj@debian:~$
事故现场:
- https://www.jianshu.com/p/2fffd0e332bc
- https://blog.csdn.net/SEUer_jeff/article/details/75578732
- https://blog.csdn.net/wangjian1204/article/details/68928656
参考教程:
- https://hub.docker.com/r/bitnami/tensorflow-serving
在这个教程中:https://github.com/tobegit3hub/tensorflow_template_application
在Ubuntu中命令应如下
python sparse_classifier.py train_file ./data/cancer/cancer_train.csv.tfrecords validate_file ./data/cancer/cancer_test.csv.tfrecords feature_size 4 label_size 3 enable_colored_log
python dense_classifier.py train_file ./data/cancer/cancer_train.csv.tfrecords validate_file ./data/cancer/cancer_test.csv.tfrecords feature_size 4 label_size 3 enable_colored_log
使用dense_classifier.py 即可产生checkpoint文件夹,可供后续在http_service中使用rest_server进行调用。但是具体调用浏览器端仍存在数组越界的问题
安装一个命令行下使用的文本浏览器便于测试使用
https://www.cnblogs.com/tsdxdx/p/7221132.html
Debian/Ubuntu: apt-get install w3m w3m-img
Centos: yum install w3m w3m-img
常见问题
不再支持export
- https://www.jianshu.com/p/91aae37f1da6
最新文章
- Redis——学习之路四(初识主从配置)
- js 简体中文拼音对应表
- 关于easyUI的模态对话框
- ab.exe使用
- bzoj1266
- Content related to smartcards (and RFID/NFC)
- php的header()函数前有echo输出情况分析
- MySQL性能、监控与灾难恢复
- L2-010. 排座位
- Ubuntu 14.04下搭建Node.js的开发环境
- SQL SERVER分区具体例子详解
- bootstrap 的可编辑下拉框 jquery.editable-select
- DML、DDL、DCL的区别
- 算法第四版 coursera公开课 普林斯顿算法 ⅠⅡ部分 Robert Sedgewick主讲《Algorithms》
- mysql安装杂记
- prototype:构造函数的真相、原型链
- 《剑指offer》第十三题(机器人的运动范围)
- hdu 4779 Tower Defense (思维+组合数学)
- AngularJS实现鼠标右键事件
- emacs之开始就加载tag