【发布时间】:2019-07-17 18:49:35
【问题描述】:
我想将 TensorFlow Graph 编译为 Movidius Graph。我使用 Model Zoo 的 ssd_mobilenet_v1_coco 模型在我自己的数据集上对其进行了训练。
然后我跑了
python object_detection/export_inference_graph.py \
--input_type=image_tensor \
--pipeline_config_path=/home/redtwo/nsir/ssd_mobilenet_v1_coco.config \
--trained_checkpoint_prefix=/home/redtwo/nsir/train/model.ckpt-3362 \
--output_directory=/home/redtwo/nsir/output
它产生了我frozen_interference_graph.pb & saved_model/saved_model.pb
现在将此保存的模型转换为 Movidius 图。有给出的命令
导出 GraphDef 文件
python3 ../tensorflow/tensorflow/python/tools/freeze_graph.py \
--input_graph=inception_v3.pb \
--input_binary=true \
--input_checkpoint=inception_v3.ckpt \
--output_graph=inception_v3_frozen.pb \
--output_node_name=InceptionV3/Predictions/Reshape_1
冻结模型以进行推理
python3 ../tensorflow/tensorflow/python/tools/freeze_graph.py \
--input_graph=inception_v3.pb \
--input_binary=true \
--input_checkpoint=inception_v3.ckpt \
--output_graph=inception_v3_frozen.pb \
--output_node_name=InceptionV3/Predictions/Reshape_1
最终可以提供给 NCS Intel Movidius SDK
mvNCCompile -s 12 inception_v3_frozen.pb -in=input -on=InceptionV3/Predictions/Reshape_1
所有这些都在英特尔 Movidius 网站上提供:https://movidius.github.io/ncsdk/tf_modelzoo.html
我的模型已经过训练,即output/frozen_inference_graph。为什么我再次使用/slim/export_inference_graph.py 冻结它,或者它是output/saved_model/saved_model.py 将作为slim/export_inference_graph.py 的输入??
我想要的只是 output_node_name=Inceptionv3/Predictions/Reshape_1。如何获取此 output_name_name 目录结构和其中的任何内容?我不知道它包含什么
我应该为模型动物园的ssd_mobilenet_v1_coco 模型使用什么输出节点(在我自己的自定义数据集上训练)
python freeze_graph.py \
--input_graph=/path/to/graph.pbtxt \
--input_checkpoint=/path/to/model.ckpt-22480 \
--input_binary=false \
--output_graph=/path/to/frozen_graph.pb \
--output_node_names="the nodes that you want to output e.g. InceptionV3/Predictions/Reshape_1 for Inception V3 "
我理解和不理解的事情: input_checkpoint: ✓ [训练期间创建的检查点] output_graph: ✓ [输出冻结图的路径] out_node_names: X
我不明白 out_node_names 参数以及考虑到它的 ssd_mobilnet 而不是 inception_v3 里面应该包含什么
系统信息
- 你正在使用的模型的顶层目录是什么:
- 我是否编写了自定义代码(而不是使用 TensorFlow 中提供的股票示例脚本):
- 操作系统平台和发行版(例如 Linux Ubuntu 16.04):Linux Ubuntu 16.04
- TensorFlow 安装自(源代码或二进制):TensorFlow 使用 pip 安装
- TensorFlow 版本(使用下面的命令):1.13.1
- Bazel 版本(如果从源代码编译):
- CUDA/cuDNN 版本:V10.1.168/7.*
- GPU 型号和内存:2080Ti 11Gb
- 复制的确切命令:
【问题讨论】:
-
ncsdk v1 & v2 已弃用 OpenVino : stackoverflow.com/questions/57145603/…
标签: tensorflow intel ncsdk movidius