Skip to content

Access regression, classification and masks submodel outputs #103

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

Open
tpostadjian opened this issue Feb 19, 2020 · 1 comment
Open

Access regression, classification and masks submodel outputs #103

tpostadjian opened this issue Feb 19, 2020 · 1 comment

Comments

@tpostadjian
Copy link

Hi,

Can one easily retrieve outputs from the regression, classification and masks submodel ?
The following trick cannot work because of the submodel embedding in a keras.Models object for each of these processes (different graphs - Keras won't allow to mix their inputs/outputs):

model = maskrcnn

regression_feature_extractor = keras.Model(inputs = model.input, outputs= model.get_layer(name="regression_submodel").get_layer("pyramid_classification_3").output)
  
classification_feature_extractor = keras.Model(inputs = model.input, outputs= model.get_layer(name="classification_submodel").get_layer("pyramid_classification_3").output)

mask_feature_extractor = keras.Model(inputs = model.input, outputs= model.get_layer(name="mask_submodel").get_layer("pyramid_classification_3").output)

Yet, I would like to get the features so as to perform further computations on these.
One way would be to build one model for each task, but model slicing in Keras is not an easy task, especially for non-sequential models (with different streams as maskrcnn exhibits), where tracking inbounds nodes at each layer is not convenient when you have several inputs for some layers (P3 --> P7 feature maps).

Any easy idea, workaround to get this done ?

Thanks !

@vcarpani
Copy link
Contributor

Hi, the easiest way to do this would be to fork this repo and pass them as outputs in the model creation

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

2 participants