9

我一直在关注“Tensorflow on Android”的 github 存储库。

  1. 我能够使用 bazel 构建代码,然后将 Android 项目导入 Android Studio,如此所述。
  2. 如您所见,使用 Android Studio 构建 APK 后,模型文件/图表包含在tensorflow/examples/android/assets
  3. 默认情况下,tensorflow_inception_graph.pb并且imagenet_comp_graph_label_strings.txt包含在构建 APK 时下载的 inception5 文件中。

有什么问题?

  1. 我有一个重新训练的图(InceptionV3 模型,在 中提到tensorflow/examples/image_retraining/retrain.py),我能够将它放在 android 目录的 assets 文件夹中并生成一个工作 APK。
  2. 我使用默认图形或 .pb 文件时的推理时间约为 500 毫秒,而我的 retrained.pb 或图形约为 1400 毫秒。(在 OnePlus3T 设备上测试)

请帮我理解

  1. 如何分析tensorflow_inception_graph.pbTensorboard 上的默认值
4

1 回答 1

7

去年五月,他们引入了一个帮助脚本import_pb_to_tensorboard来实现这一点。

usage: import_pb_to_tensorboard.py [-h] [--model_dir MODEL_DIR]
                                   [--log_dir LOG_DIR]

optional arguments:
  -h, --help            show this help message and exit
  --model_dir MODEL_DIR
                        The location of the protobuf ('pb') model to
                        visualize.
  --log_dir LOG_DIR     The location for the Tensorboard log to begin
                        visualization from.

请注意,目前,in 中的版本master似乎比1.2.1tensorflow 最新发行版中的版本更受欢迎,所以我建议使用这个版本。

于 2017-07-06T17:01:06.330 回答