Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6371 Discussions

ssd_mobilenet_v1_fpn_shared_coco model: "detection_classes is not in graph" error

emregun
New Contributor I
6,054 Views

Requirements:

Python:3.7
MacOS:Big Sur 11.2.1
Openvino:openvino_2021.3.394
Tensorflow:1.14.0

Description:

When I try to create frozen model from my ssd_mobilenet_v1_fpn_shared_coco model(checkpoint, events.out.tfevents.1613600796.emres-air, graph.pbtxt, model.ckpt-90728.meta, model.ckpt-90728.index, and pipeline.config files), I am getting "detection_classes is not in graph" error, although I am using the same output nodes as defined in intel website.

 

Could someone tell me what I am doing wrong?

 

Thanks a lot in advance.

 

My steps:

1.I downloaded following model from intel website(and output nodes are also defined in this website):

 https://docs.openvinotoolkit.org/latest/omz_models_model_ssd_mobilenet_v1_coco.html

 

2.Custom trained it with following command with my own photos:
2.1 Code:
https://github.com/tensorflow/models
(master branch)
2.2 Command:
python3.7 train.py
--logtostderr
--train_dir=/Users/Documents/Temp/tensorflow_last/models/train
--pipeline_config_path=/Users/Documents/Temp/tensorflow_last/models/ssd_mobilenet_v1_fpn_shared_box_predictor_640x640_coco14_sync.config
Note:I can also attach my config file, if it is related
2.3 Output:
...
INFO:tensorflow:global step 89547: loss = 0.0628 (8.283 sec/step)
I0629 19:34:56.030186 4505345536 learning.py:512] global step 89547: loss = 0.0128 (8.283 sec/step)
INFO:tensorflow:global step 89548: loss = 0.0596 (9.801 sec/step)
I0629 19:35:05.831597 4505345536 learning.py:512] global step 89548: loss = 0.0196 (9.801 sec/step)
...

3.I tried to convert my files(checkpoint, events.out.tfevents.1613600796.emres-air, graph.pbtxt, model.ckpt-90728.meta, model.ckpt-90728.index, and pipeline.config files) to frozen model as described in following website:

3.1 Code: https://blog.metaflow.fr/tensorflow-how-to-freeze-a-model-and-serve-it-with-a-python-api-d4f3596b3adc

Parameters:--model_dir
/Users/emre/Documents/Temp/tensorflow_last/models/train/
--output_node_names
detection_classes,detection_scores,detection_boxes,num_detections

3.2Output:At Line 51: (output_node_names.split(",")) I am getting following error message:
assert d in name_to_node, "%s is not in graph" % d
AssertionError: detection_classes is not in graph

 

Note:my expected output nodes are also not printed out in graph.pbtxt file. (please see attachment)

Best Regards

Emre

0 Kudos
23 Replies
emregun
New Contributor I
801 Views

Hi Syamimi,

Is there any progress?

 

Thanks a lot in advance.

 

Emre

0 Kudos
Syamimi_Intel
Moderator
791 Views

Hi Emre Gun,

I'm sorry for the late reply, I'm just back to work today. As for now, the best method is to change the image size according to the model.

And, yes you are correct. You will lose image quality. If you resize your images down to a smaller, and then size back up again, your image will be a lot less clear. When you resize the image back to the original size, you won't get the original image back.

 

 

Regards,

Syamimi


0 Kudos
Syamimi_Intel
Moderator
757 Views

Hi Emre Gun,

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question



Regards,

Syamimi


0 Kudos
Reply