Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with the splitting of the Faster RCNN Inception-V2 #76

Open
PoissonChasseur opened this issue May 10, 2022 · 1 comment
Open

Error with the splitting of the Faster RCNN Inception-V2 #76

PoissonChasseur opened this issue May 10, 2022 · 1 comment

Comments

@PoissonChasseur
Copy link

PoissonChasseur commented May 10, 2022

Hello,

I'm trying to use your code to split into 2 a "Faster RCNN Inception-V2" that I trained with the standard code from the "Object Detection API of Tensorflow" with Tensorflow 1.12.0.

When I try to use your code with my "frozen_inference_graph.pb" file, I have an error in the "load_graph_faster_v2.py" file because of the "Squeeze_2" and "Squeeze_3" keys (defined in "SPLIT_TARGET_NAME") which are not present in the "name_to_node_map" variable.

I looked at the contents of the "name_to_node_map" variable (that I put in a text file), but there are several squeeze layers that could relate to which one should be selected, so I'm not sure which ones should be selected in order to do it correctly.

Note: I'm a newbie to Tensorflow and object detection models.

@PoissonChasseur
Copy link
Author

PoissonChasseur commented May 10, 2022

By using Tensorboard, I saw that the correct names are probably:
["Squeeze" and "Squeeze_1"] instead of ["Squeeze_2" and "Squeeze_3"].

But I then got another error:

Building Graph
Traceback (most recent call last):
  File "C:\Users\vincentrm\Miniconda3\envs\obj_detect_4\lib\site-packages\tensorflow\python\framework\importer.py", line 418, in import_graph_def
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Node 'SecondStageBoxPredictor/AvgPool_1': Unknown input node 'SecondStageFeatureExtractor/InceptionV2/Mixed_5c/concat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Obj_detection_3\naisy - realtime_object_detection-master\run_image.py", line 147, in main
    detection.start(cfg)
  File "D:\Obj_detection_3\naisy - realtime_object_detection-master\lib\detection_faster_v2.py", line 74, in start
    graph = load_frozen_graph.load_graph()
  File "D:\Obj_detection_3\naisy - realtime_object_detection-master\lib\load_graph_faster_v2.py", line 35, in load_graph
    return self.load_frozen_graph_with_split()
  File "D:\Obj_detection_3\naisy - realtime_object_detection-master\lib\load_graph_faster_v2.py", line 312, in load_frozen_graph_with_split
    tf.import_graph_def(remove, name='')
  File "C:\Users\vincentrm\Miniconda3\envs\obj_detect_4\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
    return func(*args, **kwargs)
  File "C:\Users\vincentrm\Miniconda3\envs\obj_detect_4\lib\site-packages\tensorflow\python\framework\importer.py", line 422, in import_graph_def
    raise ValueError(str(e))
ValueError: Node 'SecondStageBoxPredictor/AvgPool_1': Unknown input node 'SecondStageFeatureExtractor/InceptionV2/Mixed_5c/concat'

However, I clearly see that it seem correct in the original graph with Tensorboard, so I don't understand how to solve this error.

The code also work well without the splitting.

@PoissonChasseur PoissonChasseur changed the title split_model for Faster RCNN Inception-V2 not working due to wrong keys in SPLIT_TARGET_NAME Error with the splitting of the Faster RCNN Inception-V2 May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant