使用Tensorflow构建一个Android应用 [英] Build an android app using Tensorflow

查看:76
本文介绍了使用Tensorflow构建一个Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想分开 TensorFlow Android摄像头演示来自Tensorflow的回购.

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

有没有一种方法可以在不更改tensorflow repo的情况下做到这一点?

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

最终结构应如下所示:

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

换句话说,如何将Tensorflow回购作为打包导入bazel中?

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

推荐答案

如果要将字面上的目录复制到您的my_project目录中,则可以.然后将以下行添加到您的my_project/WORKSPACE文件中:

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
 )

然后,您可以依赖项目中tensorflow中的任何目标,例如@my_tensorflow//tensorflow:workspace.bzl.

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

看看Tensorflow的服务"项目,它看起来像您想要做的: https://github.com/tensorflow/serving/blob/master/WORKSPACE .

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.

这篇关于使用Tensorflow构建一个Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆