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

Features/region proposal network losses small fixes #55

Conversation

hgaiser
Copy link
Contributor

@hgaiser hgaiser commented Aug 3, 2017

This PR fixes some small issues that caused the model not to compile.

In addition I noticed that all inputs are shaped including their batch dimension. I wasn't completely aware of this and I'm not sure the current implementation handles it correctly (ie. it might assume a shape of (None, 4) while it is actually (None, None, 4)). @jhung0 @0x00b1 are you aware of this?

@jhung0
Copy link
Contributor

jhung0 commented Aug 3, 2017

@hgaiser
Yeah, I noticed that issue, and we should be consistent about it...so let's try to make sure batch dimension is included

@@ -30,15 +30,15 @@ def __init__(self, inputs, features, heads, rois):

rpn_prediction = keras.layers.concatenate([rpn_classification, rpn_regression])

proposals = keras_rcnn.layers.object_detection.ObjectProposal(rois)([im_info, rpn_regression, rpn_classification])
anchors = keras_rcnn.layers.object_detection.ProposalTarget()([rpn_classification, gt_boxes, im_info])
proposals = keras_rcnn.layers.object_detection.ObjectProposal(rois)([im_info, rpn_regression, rpn_classification])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the object_detection part of this and the next line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@hgaiser
Copy link
Contributor Author

hgaiser commented Aug 3, 2017

Yeah with these changes I got a successful model summary (not really the same as compiling I guess).

return (None,), (None, 4)
return [(None,), (None, 4)]

def compute_mask(self, inputs, mask=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is trying to call output_mask for all outputs. I'm not sure why it isn't required for a single output, but for multiple outputs it seems to be required (keras-team/keras#3061). Perhaps something we should try to fix in Keras.

@@ -30,15 +30,15 @@ def __init__(self, inputs, features, heads, rois):

rpn_prediction = keras.layers.concatenate([rpn_classification, rpn_regression])

proposals = keras_rcnn.layers.object_detection.ObjectProposal(rois)([im_info, rpn_regression, rpn_classification])
anchors = keras_rcnn.layers.object_detection.ProposalTarget()([rpn_classification, gt_boxes, im_info])
proposals = keras_rcnn.layers.ObjectProposal(rois)([im_info, rpn_regression, rpn_classification])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not necessary, but it'd be clearer to have maximum_proposals=rois instead of just rois
Also, ObjectProposal and ProposalTarget have im_info in different orders...we should be consistent. Could you switch it so that im_info comes at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Will you make this change or should I?

@jhung0
Copy link
Contributor

jhung0 commented Aug 4, 2017

Are you able to train?

@jhung0 jhung0 merged commit cf404e8 into broadinstitute:features/region-proposal-network-losses Aug 4, 2017
@hgaiser
Copy link
Contributor Author

hgaiser commented Aug 4, 2017

No I didn't try training yet (are the loss layers used already?). I only got a seemingly logical model summary.

@hgaiser hgaiser deleted the features/region-proposal-network-losses-small-fixes branch August 8, 2017 14:05
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

Successfully merging this pull request may close these issues.

None yet

2 participants