HenriquesLab / ZeroCostDL4Mic

ZeroCostDL4Mic: A Google Colab based no-cost toolbox to explore Deep-Learning in Microscopy
MIT License
566 stars 130 forks source link

StarDist 2D Notebook fail on Google Colab: tensorflow1 not supported in Colab - should be updated to use Tensorflow 2 #201

Closed ofrag closed 2 years ago

ofrag commented 2 years ago

Describe the bug I'm trying to run StarDist 2D notebook in Google Colab It fails at stage 1.3 with the following error message:

ValueError: Tensorflow 1 is unsupported in Colab.

Your notebook should be updated to use Tensorflow 2.
See the guide at https://www.tensorflow.org/guide/migrate#migrate-from-tensorflow-1x-to-tensorflow-2.

I wonder if there is an updated notebook, or should I go through the migration myself ?

Thanks Ofra

I use Chrome on Windows 10 and the notebook version is:

Notebook_version = '1.13' Network = 'StarDist 2D'

Vathys commented 2 years ago

I'm having the same problems but with YOLOv2.

guijacquemet commented 2 years ago

Hi @ofrag and @Vathys Thanks for reaching out! Yes, it looks like google colab does not support TF1.15.2 anymore, causing issues in several notebooks. We are on the case and will fix them as soon as possible. StarDist2D is now working again using TF2.8.

Cheers

Guillaume

ofrag commented 2 years ago

Thanks @guijacquemet for the quick fix It is working great again !!!

Ofra

ofrag commented 2 years ago

@guijacquemet,

I think that the previous notebook saved the model into TF_SavedModel.zip that I could convert to onnx for use in QuPath using tf2onnx, as described for example in: https://c4science.ch/w/bioimaging_and_optics_platform_biop/image-processing/qupath/

Do you have any idea how this can be achieved with the output of the updated notebook ?

Thanks Ofra

guijacquemet commented 2 years ago

Hi @ofrag

We released a new version of the notebook that now uses TF2.2. The trained model should be compatible with the Fiji StarDist plugin. The model export is also enabled again. I hope you can convert these models using tf2onnx. Otherwise, you could also use the StarDist notebook to export to the bioimage.io file format. This format should also be compatible with Qpath

ofrag commented 2 years ago

@guijacquemet

Thanks for all your support, the trained model is working well in QuPath !!! (after conversion using tf2onnx on the unzipped TF_Saved_Model)

Ofra