Tensorflow serving的編譯


Tensorflow serving提供了部署tensorflow生成的模型給線上服務的方法,包括模型的exportload等等。

安裝參考這個

https://github.com/tensorflow/serving/blob/master/tensorflow_serving/g3doc/setup.md

   

但是由於被qiang的問題 (googlesource無法訪問)

https://github.com/tensorflow/serving/issues/6

需要修改一下 WORKSPACE文件

new_http_archive(

name = "gmock_archive",

#url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip",

url = "https://github.com/peter-wangxu/gmock/archive/1.7.0.zip",

#sha256 = "26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b",

sha256 = "9b0018413f4222b8ee5454a431918c324d010062eecb078677b6897d0c76bc42",

build_file = "tensorflow/google/protobuf/gmock.BUILD",

)

   

git_repository(

name = "boringssl_git",

#commit = "436432d849b83ab90f18773e4ae1c7a8f148f48d",

commit = "db0729054d5964feab9e60089ba2d06a181e78b1",

init_submodules = True,

#remote = "https://github.com/mdsteele/boringssl-bazel.git",

remote = "https://github.com/doubler/boringssl-bazel.git",

)

最近發現一個付費vpn,但是更方便一些,免得修改了。。 

http://www.lvdou888.com/intro/  綠豆vpn 挺好用 我在win下開啟 可以再ubuntu下面命令行執行bazel 什么訪問暢通了。。  還是很贊 

   

注意需要先進入tensorflow路徑

./configure一下

   

   

bazel build tensorflow_serving/…

   

最后驗證一下

./bazel-bin/tensorflow_serving/example/mnist_inference --port=9000 ~/tmp/

I tensorflow_serving/session_bundle/session_bundle.cc:109] Attempting to load a SessionBundle from: /home/gezi/tmp/

E tensorflow_serving/example/mnist_inference.cc:190] Fail to load tensorflow export: /home/gezi/tmp/export.meta

gezi:~/other/serving$ bazel test tensorflow_serving/...

WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.

INFO: Found 89 targets and 36 test targets...

INFO: Elapsed time: 31.664s, Critical Path: 28.86s

//tensorflow_serving/batching:batch_scheduler_test PASSED in 0.3s

//tensorflow_serving/batching:retrier_test PASSED in 0.2s

//tensorflow_serving/batching:streaming_batch_scheduler_test PASSED in 4.1s

//tensorflow_serving/batching/test_util:puppet_batch_scheduler_test PASSED in 0.2s

//tensorflow_serving/core:availability_helpers_test PASSED in 0.3s

//tensorflow_serving/core:dynamic_manager_benchmark PASSED in 28.5s

//tensorflow_serving/core:dynamic_manager_test PASSED in 0.3s

//tensorflow_serving/core:eager_load_policy_test PASSED in 0.2s

   

   

   


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM