Error response:/usr/bin/tf_serving_entrypoint.sh: line 3: 6 Illegal instruction (core dumped) ...
用docker部署tensorflow-serving:gpu时,参照官方文档:https://tensorflow.google.cn/tfx/serving/docker
本应该是很简单的部署,没想到会一直出现这个错误:

经过github和网上的一个朋友了解到,关键问题可能是服务器机器的cpu比较弱(原来是我的cpu确实比较弱:我是在服务器分出来的一个虚拟机上部署的,本质是一个虚拟机,不是一个实体机。)
我的解决方式:将虚拟机更换为实体机,从服务器上直接分出一块CPU供部署使用,然后就解决了这个问题。

疑问:从github中的那位朋友下面的描述看出,即使不更换cpu,似乎也能从别的方法来解决这个问题:我们上面的部署是直接pull 镜像: docker pull tensorflow/serving:latest-gpu
我是通过github文档中获取的方法:https://github.com/tensorflow/serving/blob/master/tensorflow_serving/tools/docker/Dockerfile.gpu
不是直接拉取 tensorflow/serving:latest-gpu这个镜像文件,而是通过Dockerfile.gpu,自己"做"一个镜像文件,然后拉取
1.Clone the TensorFlow Serving project
git clone https://github.com/tensorflow/serving
cd serving
2.Build an image with an optimized ModelServer
For CPU: docker build --pull -t $USER/tensorflow-serving-devel \
-f tensorflow_serving/tools/docker/Dockerfile.devel .
For GPU: docker build --pull -t $USER/tensorflow-serving-devel-gpu \
-f tensorflow_serving/tools/docker/Dockerfile.devel-gpu .
3.Build a serving image with the development image as a base
For CPU: docker build -t $USER/tensorflow-serving \
--build-arg TF_SERVING_BUILD_IMAGE=$USER/tensorflow-serving-devel \
-f tensorflow_serving/tools/docker/Dockerfile .
For GPU: docker build -t $USER/tensorflow-serving-gpu \
--build-arg TF_SERVING_BUILD_IMAGE=$USER/tensorflow-serving-devel-gpu \
-f tensorflow_serving/tools/docker/Dockerfile.gpu . # Your new optimized Docker image is now$USER/tensorflow-serving-gpu, which you can use just as you would the standardtensorflow/serving:latest-gpuimage.
注意:Dockerfile.gpu这个文件里:要注意里面的CUDA,cuDNN,tensorRT,MODEL_NAME,BASE_PATH_MODEL等这些参数要一一对应好(在服务器上安装好)
第2步和第3步的时间比较长,需要耐心等待一下。
然后执行:
sudo docker image ls
就可以查看到新拉取的镜像信息:$USER/tensorflow/serving-gpu:latest 大小为2.4G左右吧(我用的是这个)
然后打开容器:
docker run --runtime=nvidia -p 8501:8501 \
--mount type=bind,\
source=/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_gpu,\
target=/models/half_plus_two \
-e MODEL_NAME=half_plus_two -t tensorflow/serving:latest-gpu & 注意:我标红的镜像要修改了,改为:$USER/tensorflow/serving-gpu:latest(每个人不一样)
然后执行之后,显示模型获取成功了,但是出现了关于CUDA的一些问题,其实这个问题我到现在还没有解决,然后哪位朋友知道了这个如何解决,能不能告诉我一下,在下方留言和我说说呗。

Error response:/usr/bin/tf_serving_entrypoint.sh: line 3: 6 Illegal instruction (core dumped) ...的更多相关文章
- httpd: config error '*.php:/usr/bin/php-cgi' in '/etc/httpd.conf'
/********************************************************************************* * httpd: config e ...
- Mac 无法安装安装psutil 报错 error: command '/usr/bin/clang' failed with exit status 1
psutil是一个特别好用来检查系统资源的一个包, 但是 在Mac安装却总是报错 查看监控系统脚本, 点这里 mac系统版本: Macos Mojave 10.14.3 报错信息如下: WARNING ...
- python报错使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: SyntaxError: invalid syntax问题
参考链接:https://blog.csdn.net/ltz150/article/details/77870735 1.背景: CentOS 7升级Python到3.6.2后,需要在/usr/bin ...
- 执行sh脚本报“/usr/bin/env: "sh\r": 没有那个文件或目录”错误
出现这个错误的原因是出错的语句后面多了“\r”这个字符,换言之,脚本文件格式的问题,我们只需要把格式改成unix即可: vi xx.sh :set ff :set ff=unix :wq!
- sublime Error executing: /usr/bin/security dump-trust-settings -d
sublime text2突然crash,无法简单粗暴的关闭,就开始认真解决这个问题. 问题: 参考文献:https://github.com/wbond/package_control/issues ...
- tomcat报错catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory
将生产服务器的Tomcat目录打包过来后解压后,启动Tomcat后,发现如下问题: # ./shutdown.sh Using CATALINA_BASE: /usr/local/tomcat ...
- tomcat报错catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory(转)
原文:https://blog.csdn.net/reblue520/article/details/52588825 将生产服务器的Tomcat目录打包过来后解压后,启动Tomcat后,发现如下问题 ...
- 【转】“/usr/bin/ld: cannot find -lz”
原文网址:http://stackoverflow.com/questions/3373995/usr-bin-ld-cannot-find-lz I am trying to compile And ...
- #!/usr/bin/env 脚本解释程序的作用
the Zimbu programming language http://www.zimbu.org/getting-started -------------------------------- ...
随机推荐
- php中的几种四舍五入取整、向上取整、向下取整、小数截取方法
echo intval(4.5);echo "<br />";//直接取整,舍弃小数保留整数echo round(4.5);echo "<br /> ...
- JavaScript中遍历数组,最好不要用for...in
先看一段代码 var arr = [2,3,4,5]; for(var i = 0; i < arr.length; i++){ console.log(i,"类型:"+ty ...
- K-th K
题目描述 You are given an integer sequence x of length N. Determine if there exists an integer sequence ...
- 【转】HeadFirst 组合模式+迭代器错误原因以及解决代码
http://blog.csdn.net/sugar_girl/article/details/53400267 <HeadFirst JAVA设计模式>中用迭代器迭代组合模式是存 ...
- 快速进入当前目录的cmd窗口
- maven 多bundle项目
1 环境 eclipse maven jdk1.8 多bundle项目需要一个父项目(聚合模块),起到聚合其他模块的作用,其他模块的管理工具,不包含实际的代码. 新建maven项目-->Crea ...
- linux openjdk安装
sudo apt-get install openjdk-8-jdk 默认提示是 sudo apt-get install openjdk-8-jre, 这个只有jre https://openjdk ...
- shell-变量学习-01
1.变量 1.1 变量赋值 > variable_zhou="hello world!" #等号两边不能有空格 1.2 使用变量 > echo $variabl ...
- JQuery中易混淆的概念
append(): 向每个匹配的元素内部追加内容. <p>I would like to say: </p> $("p").append("< ...
- 吴裕雄--天生自然HTML学习笔记:关闭8080端口被占用怎么办?关闭8080端口被占用