train_ssd_mobilenet icon indicating copy to clipboard operation
train_ssd_mobilenet copied to clipboard

faster_rcnn frozen graph issue

Open eeerrrwwwuuu opened this issue 5 years ago • 6 comments

I have problem with loading frozen graph of faster_rcnn v2 graph. I trained it by my own with just one class... it looks like training process was successful, I was even able to export it to freeze state.

  1. I did change in config file to point my graph

model_type: 'faster_v2' model_path: '/home/nvidia/Desktop/Real_Time/realtime_object_detection/models/faster_rcnn_v1/frozen_inference_graph.pb'

but during execution of run_video.py I get error on load_graph_faster_v2.py

i get warning that

assert d in name_to_node_map, "%s is not in graph" % d AssertionError: Squeeze_2 is not in graph

where content of dest_nodes looks like :

['SecondStagePostprocessor/stack_1', 'SecondStagePostprocessor/BatchMultiClassNonMaxSuppression/map/strided_slice', 'BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArrayGatherV3', 'Squeeze_2', 'Squeeze_3', 'SecondStagePostprocessor/Reshape_4']

eeerrrwwwuuu avatar Feb 28 '19 21:02 eeerrrwwwuuu

Ok I think I found solution : split_model: False but it gives 0.2 FPS :(

eeerrrwwwuuu avatar Feb 28 '19 21:02 eeerrrwwwuuu

Hi @eeerrrwwwuuu,

Probably this problem is the same as the following problem. https://github.com/naisy/realtime_object_detection/issues/53

This is speculated that the Faster RCNN model has changed. Actually, the published model (old structure) is different from the your model (new structure). And new structure is slow. Thanks to tesfagabir's cooperation I tried to write a split code, but I could not improve speed. I think it is better to learn using the old commit of tensorflow/models.

naisy avatar Mar 01 '19 02:03 naisy

Ok, now I get the point, what would be the ideal solution to train model and get maximum performance from faster_rcnn on jetson tx2? Should I pick Nvidia implementation or optimize graph somehow ? I have a problem that I want to handle 4 cameras at once and I'm able to start only one instance of recognition api, so I need to implement some kind of queue. How many FPS I can get on older version of faster_rcnn, on ssd_coco I had about 20 frames of 800x600 but this model is not capturing small objects correctly... I need about 8fps ( 4 x 2 fps ) to deal with my task. img_20190228_233322

eeerrrwwwuuu avatar Mar 01 '19 11:03 eeerrrwwwuuu

Hi @eeerrrwwwuuu,

If it is 0.2 FPS at the current Faster RCNN, I think that the old Faster RCNN will be around 0.3-0.4 FPS. To get 8 FPS with Faster RCNN, you need desktop GPU. It will be impossible to achieve 8 FPS with Jetson.

naisy avatar Mar 03 '19 04:03 naisy

Hmm.. 0.2 was on debug, in normal 2.1 fps, but video input was about HD size, I'm expecting 800x600 on input..so 3fps in possible. Ssd is much quicker I get about 20fps but I don't believe that this model will catch small objects. I made mistake during training of Ssd and I used only 170 objects to train. Tell me does ssd is able to capture small objects (like in photo)?

On Sun, 3 Mar 2019, 05:22 naisy, [email protected] wrote:

Hi @eeerrrwwwuuu https://github.com/eeerrrwwwuuu,

If it is 0.2 FPS at the current Faster RCNN, I think that the old Faster RCNN will be around 0.3-0.4 FPS. To get 8 FPS with Faster RCNN, you need desktop GPU. It will be impossible to achieve 8 FPS with Jetson.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/naisy/train_ssd_mobilenet/issues/6#issuecomment-468987095, or mute the thread https://github.com/notifications/unsubscribe-auth/AcwrpTmERSNdR-VHxMSh9vPwt6lWrFCHks5vS04agaJpZM4bXxsW .

eeerrrwwwuuu avatar Mar 03 '19 10:03 eeerrrwwwuuu

The picture is taken when running ssd_mobilenet_v1 on TX2. fifa-tx2

Unfortunately, I do not know the training parameters for this, but it seems that detection of small objects is done so well.

I have not tried it yet, how about trial and error on data_augmentation_options with reference to this?

https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/facessd_mobilenet_v2_quantized_320x320_open_image_v4.config

https://github.com/tensorflow/models/blob/master/research/object_detection/core/preprocessor.py

naisy avatar Mar 03 '19 12:03 naisy