Build an android app using Tensorflow

馋奶兔 提交于 2019-12-12 04:23:33

问题


I'd like to separate the TensorFlow Android Camera Demo from the repo of Tensorflow.

Is there a way to do that without changing anything to the tensorflow repo ?

The final structure should be something like this:

my_project
|-- WORKSPACE
|-- my_android_app
|   |-- BUILD
|   `-- ...
|-- tensorflow
|   |-- tensorflow
|   |   |   |-- workspace.bzl
|   |   |   |-- tensorflow.bzl
|   |   |   `-- ...
|   |-- WORKSPACE
|   |-- BUILD
.    `-- ...

In other words, how to import Tensorflow repo as a package in bazel ?


回答1:


If you want to literally copy the directory into your my_project directory, you can. Then add the following lines to your my_project/WORKSPACE file:

 local_repository(
     name = "my_tensorflow",
     path = "./tensorflow", # Relative path to the tensorflow workspace
 )

Then you can depend on any targets from tensorflow in your project, e.g., @my_tensorflow//tensorflow:workspace.bzl.

Take a look at Tensorflow's "serving" project, which does what it looks like you're trying to do: https://github.com/tensorflow/serving/blob/master/WORKSPACE.



来源:https://stackoverflow.com/questions/40743216/build-an-android-app-using-tensorflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!