core-bioimage-io-python icon indicating copy to clipboard operation
core-bioimage-io-python copied to clipboard

Support adding multiple weights using build_model

Open oeway opened this issue 2 years ago • 4 comments

Discussion from the BMZ meeting, proposed by @ivan-ea

Would be nice to support adding multiple weights in the build_model function.

cc @constantinpape @FynnBe

oeway avatar Nov 09 '22 15:11 oeway

For context: I was not sure if it was possible to generate models with multiple weight files with the build_model function. Also I wondered if I missed something, since the website has the option to choose between several weight formats to download.

Some models have 2 weights in the rdf (for example impartial-shrimp), so I was curious how they might have built them.

ivan-ea avatar Nov 09 '22 15:11 ivan-ea

Adding multiple weights is supported, but not directly via the build_model function. Instead, you would need to use add_weights. (As a side note: we should add this to the model creation notebook).

I think having the option to do this directly in build_model would be nice, but I don't have capacity to implement this at this points; but I would be happy to review a PR if someone wants to give it a try.

constantinpape avatar Nov 09 '22 17:11 constantinpape

Thanks @constantinpape the add_weights function seems exactly what I was missing. I was following the model creation notebook, since I need to get the deepimagej_config too. Maybe I could add the add_weights to the example notebook once I figure out how to use it.

ivan-ea avatar Nov 10 '22 07:11 ivan-ea

Maybe I could add the add_weights to the example notebook once I figure out how to use it.

That would be great!

constantinpape avatar Nov 10 '22 08:11 constantinpape