我正在遵循Roboflow的Google Colab指南,以训练从自定义数据集上的Tensorflow训练MobilenetsSD对象检测模型。这是指向COLAB指南的链接:
数据集是Roboflow网站的示例集,称为“国际象棋样本”,每个人在网站上注册帐户的每个人都可以在其Workspace文件夹中获取。这是要获得该设置的链接: https://blog.roboboboflow.com/获取启动 - roboflow/
COLAB指南返回一个冷冻图,我想使用此代码将其转换为tfjs_graph_model:使用此代码:
tensorflowjs_converter \
--input_format=tf_saved_model \
--output_node_names='MobilenetV1/Predictions/Reshape_1' \
--saved_model_tags=serve \
/mobilenet/saved_model \
/mobilenet/web_model
在COLAB中运行它时,我会遇到以下错误:
KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph."
我认为问题是“ MobilenetV1” /predivions/reshape_1“不是输出节点。可能可以在COLAB指南中找到正确的输出节点名称。
I'm following a Google Colab guide from Roboflow to train the MobileNetSSD Object detection model from Tensorflow on a custom dataset. Here is the link to the colab guide: https://colab.research.google.com/drive/1wTMIrJhYsQdq_u7ROOkf0Lu_fsX5Mu8a
The data set is the example set from the Roboflow website called "Chess sample" which everyone who registers an account on the website gets in their workspace folder. Here is the link to get that setup: https://blog.roboflow.com/getting-started-with-roboflow/
The Colab guide returns a frozen graph and i want to convert it to a tfjs_graph_model using this code:
tensorflowjs_converter \
--input_format=tf_saved_model \
--output_node_names='MobilenetV1/Predictions/Reshape_1' \
--saved_model_tags=serve \
/mobilenet/saved_model \
/mobilenet/web_model
when running this in Colab i get following error:
KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph."
I think the problem is that "MobilenetV1/Predictions/Reshape_1" is not an output node. Probably the right output node names can be found in the Colab guide.
发布评论
评论(1)
我只是经历了同一件事,我找不到其他方法来查看冷冻模型的输出节点名称,但是感谢上帝,因为我发现了网站 www.netron.app
我上传了我的冷冻推理图(.pb)和netron.app产生了一个节点的gui树。
我单击了第二个底部节点,并显示了该节点的属性,在底部有一个输出部分,其中一个值显示了我用于-ANDPUT_NODE_NAMES的操作名称。
我替换了
-ustput_node_names ='Mobilenetv1/predivions/reshape_1'
和
-ustput_node_names =后处理器/batchmulticlassnonmaxsuppression/map/tensorarraystack/tensorarraygatherv3
我只是告诉您如何使用训练有素的冷冻模型来解决此问题。输出节点名称可能与您的名称不同。
I was just experiencing the same thing, and I could not find other ways to see the output node names of a frozen model, but thank God because I discovered the website www.netron.app
I uploaded my frozen inference graph (.pb) and netron.app produced a gui tree of nodes.
I clicked the second to the last bottom node, and it shows the properties of that node, and at the bottom there was the Outputs section with a value showing the operation names that I used for the --output_node_names.
I replaced the
--output_node_names='MobilenetV1/Predictions/Reshape_1'
with
--output_node_names=Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/TensorArrayGatherV3
I am just telling you how I solved this with my trained frozen model. The output node names will probably not be the same as yours.