ome / EMBL-EBI-imaging-course-05-2023

BSD 2-Clause "Simplified" License
4 stars 4 forks source link

Stardist day 4 #17

Open pwalczysko opened 8 months ago

pwalczysko commented 8 months ago

Day 4 In Google Colab, run cell

from stardist.models import StarDist2D
model_versatile = StarDist2D.from_pretrained('2D_demo')

Observe error

---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

[<ipython-input-8-03d1d2f32c05>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from stardist.models import StarDist2D
      2 model_versatile = StarDist2D.from_pretrained('2D_demo')

3 frames

[/usr/local/lib/python3.10/dist-packages/stardist/models/model2d.py](https://localhost:8080/#) in __init__(self, axes, n_rays, n_channel_in, grid, n_classes, backbone, **kwargs)
    235         self.train_tensorboard         = True
    236         # the parameter 'min_delta' was called 'epsilon' for keras<=2.1.5
--> 237         min_delta_key = 'epsilon' if LooseVersion(keras.__version__)<=LooseVersion('2.1.5') else 'min_delta'
    238         self.train_reduce_lr           = {'factor': 0.5, 'patience': 40, min_delta_key: 0}
    239 

AttributeError: module 'tensorflow.keras' has no attribute '__version__'

cc @jburel

pwalczysko commented 8 months ago

Note: The same https://github.com/ome/EMBL-EBI-imaging-course-05-2023/blob/main/Day_4/environment_stardist.yml works fine when built locally on Mac M1 - the notebook stardist... works as expected on the local build.