bioimage-io / collection-bioimage-io

(deprecated in favor of bioimage-io/collection) RDF collection for BioImage.IO
5 stars 9 forks source link

Update Mitochondria confocal microscopy inference DFCAN #595

Closed bioimageiobot closed 1 year ago

bioimageiobot commented 1 year ago

This is an automatic PR created by the @bioimageiobot regarding changes to the resource item 10.5281/zenodo.7781877. The following version(s) will be added:

Please review the changes and make sure the new item or version(s) pass the following check list:

Maintainers: @esgomezm, @IvanHCenalmor

Note: If you updated or re-uploaded another version for the current item on Zenodo, this PR won't be changed automatically. To proceed, you can do the following:

  1. Block this version, but keep looking for future versions: Edit the current resource.yaml and keep the top-level status field as accepted, but change the status under the current version to blocked.
  2. Accept this version and keep looking for future versions: Merge this PR for now.
  3. Keep proposed version(s) (and this resource in general if it is new) as pending: Close this PR without merging.

    Then wait for the CI on the main branch to complete. It should detect the new version(s) and create another PR for the new version(s).

Previous PRs of this resource: https://github.com/bioimage-io/collection-bioimage-io/pull/589

IvanHCenalmor commented 1 year ago

Hi @FynnBe,

I tried using a notebook that only had the TF version 2.11.0 and the model actually builds using the bioimageio function but we have uploaded it and still gives the same error.

I have created a GitHub repo with the conda environment configuration, the notebook, the weights and the input image: https://github.com/IvanHCenalmor/DFCAN_bioimageio.git

I have tried to install the less libraries as possible, only TF=2.11.0, bioimageio core and skimage.

Should I tried another TF version?

FynnBe commented 1 year ago

I tried using a notebook that only had the TF version 2.11.0 and the model actually builds using the bioimageio function but we have uploaded it and still gives the same error.

if you mean using the bioimageio.core.build_model function by "build the model" then note that this does not include testing the model. (maybe we should add that there though!). Not sure when I'll have the time to look into this particular issue further, so if you want to try yourself already: I would add test_model() in that notebook/environment:

dfcan_model = build_model(....)
test_model(dfcan_model)

and see if I can get this minimal example running. -- no upload etc needed to test.

esgomezm commented 1 year ago

Hi @FynnBe

We tested the model after building it with the validate_model and test_model functions. That's why it's confusing that then it doesn't pass the tests in the CI. I was wondering wether it has to do with defining new layers with Keras functions

FynnBe commented 1 year ago

I was wondering wether it has to do with defining new layers with Keras functions

that is probably the issue. In the notebook where it works you also have from tensorflow.keras import backend as K so it makes sense the the error K not defined does not occur there. Maybe if you'd use tensorflow.keras.backend instead of renaming it K in the code it woks...

When running the dynamic tests in the env that only has TF and bioimageio.core we do not know to import K before running the test... To reproduce the error test the model only with this code:

from bioimageio.core import test_model

test_model(".../locally_exported_model_zip")
FynnBe commented 1 year ago

@IvanHCenalmor any updates on this?

esgomezm commented 1 year ago

@IvanHCenalmor I think this model makes no sense having it there anymore unless you want to you use it for some CI testing of Pytorch. If not, please, close the pull request with the model blocked

bioimageiobot commented 1 year ago

preview-collection-json