今天在测试Tensorflow Serving Docker 的代码,前面一直是报错,说找不到libcuda.so,
libcuda reported version is: Not found: was unable to find libcuda.so
DSO loaded into this program
查询了很多解决方案,发现需要dockerfile 立执行 参考链接
run rm /usr/local/cuda/lib64/stubs/libcuda.so.1 fixed my problem
但是这个涉及到了DockerFile,然后我想看看能不能从根本解决这个问题,我们原来使用 TF1.9 gpu,现在使用latest的docker,然后用tensorflow serving Docker的官方代码测试Tensorflow
执行代码
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 &
但是还是会报错
invalid argument "type=bind,source=/tmp/tfserving/serving/tensorflow_serving/
servables/tensorflow/testdata/saved_model_half_plus_two_cpu,"
for "--mount" flag: invalid field '' must be a key=value pair
参考这位同学的答案,原来是指令会报错的原因是里面有空格,最后我把斜杠全部去掉就可以了
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
这样就正常启动了