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 #589

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: none

esgomezm commented 1 year ago

Hey @FynnBe and @constantinpape we tested this model using the bioimageio.core library (test_model) and it passed for both keras and tensorflow. However, it fails here. Any idea?

FynnBe commented 1 year ago

the error:

'Exception encountered when calling layer "lambda_833" (type Lambda).\n'
'\n'
"name 'K' is not defined\n"

seems to be related to the tf/keras version used: https://github.com/tensorflow/tensorflow/issues/54198

and internally caused by some missing

from keras import backend as K

https://stackoverflow.com/questions/72489926/keras-name-k-is-not-defined

The conda environment the CI runs the test in is:

channels: [conda-forge]
dependencies: [bioimageio.core, tensorflow ==2.11.*]

Are you sure you are testing locally with TF 2.11? If so, is it installed via pip? And was the model created with TF 2.11 or maybe an earlier version?

IvanHCenalmor commented 1 year ago

The model was taken from: https://github.com/qc17-THU/DL-SR .

They specify that in their environment they use:

The layers have been updated and instead of using the ones from Keras, they are imported from TF as it is done in: https://github.com/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/Beta%20notebooks/DFCAN_ZeroCostDL4Mic.ipynb .

In the colab notebook, that is where the testing (test_model) is done, the version of TF is tf.__version__ == '2.11.0' .

Which one should be the solution, changing the TF version in the colab notebook?

FynnBe commented 1 year ago

@IvanHCenalmor Could you try to test the model in a separate script/notebook? In the linked zero cost notebook, from tensorflow.keras import backend as K is included, thus K available... maybe reexporting the model with TF 2.11 in that environment can help.