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

output_names=[out.op.name for out in model.outputs][:4] should be modified to get the 5 loss nodes #22

Open
cpoptic opened this issue Oct 16, 2019 · 2 comments

Comments

@cpoptic
Copy link

cpoptic commented Oct 16, 2019

Line 50 of main.py:

def freeze_model(model, name):
    frozen_graph = freeze_session(
        sess,
        output_names=[out.op.name for out in model.outputs][:4])

Correct me if I'm wrong, but using the first 4 output names [:4] of your output_names is not guaranteed to get the correct output node names.

What we really want are the 5 output nodes regarding Mask RCNN loss:

rpn_class_loss
rpn_bbox_loss
mrcnn_class_loss
mrcnn_bbox_loss
mrcnn_mask_loss

When I run [out.op.name for out in keras_model.model.outputs]
I get 14 output nodes:

['rpn_class_logits/concat',
'rpn_class/concat',
'rpn_bbox/concat',
'mrcnn_class_logits/Reshape_1',
'mrcnn_class/Reshape_1',
'mrcnn_bbox/Reshape',
'mrcnn_mask/Reshape_1',
'ROI/packed_2',
'output_rois/mul',
'rpn_class_loss/cond/Merge',
'rpn_bbox_loss/cond/Merge',
'mrcnn_class_loss/truediv',
'mrcnn_bbox_loss/Mean',
'mrcnn_mask_loss/Mean']

So, at least for this particular model, the desired output nodes are actually the last 5 of these nodes: `output_names=[out.op.name for out in model.outputs][-5:])

Am I missing something?

@bendangnuksung
Copy link
Owner

When I added and run

# main.py  line no: 48
 print([out.op.name for out in model.outputs])

I am getting this values ['mrcnn_detection/Reshape_1', 'mrcnn_class/Reshape_1', 'mrcnn_bbox/Reshape', 'mrcnn_mask/Reshape_1', 'ROI/packed_2', 'rpn_class/concat', 'rpn_bbox/concat']
So all we need is the first four output values i.e: mrcnn_detection, mrcnn_class, mrcnn_bbox, mrcnn_mask.
I am not sure how you got those many values. You can replicate the above print statement and check.
`

@sourcedexter
Copy link

I think you are running an older version perhaps. Because. Using the code you have used above, even I am getting 14 tensors for output

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

3 participants