matjesg / deepflash2

A deep-learning pipeline for segmentation of ambiguous microscopic images.
https://matjesg.github.io/deepflash2/
Apache License 2.0
58 stars 11 forks source link

Set up environment - 'functools.partial' object has no attribute 'RandomGamma' #57

Open AscheJan opened 4 months ago

AscheJan commented 4 months ago

In Google Colab when you start the set up environment you get the following error:

@title Set up environment

@markdown Please run this cell to get started (~1 minute)

from IPython.display import clear_output, HTML !pip install -Uqq deepflash2

!pip install git+https://github.com/matjesg/deepflash2.git@master

import deepflash2 from deepflash2.gui import GUI, _connect_to_drive clear_output(wait=True) display(HTML(f'Using deepflash2 version {deepflash2.version}')) path=_connect_to_drive()


AttributeError Traceback (most recent call last)

in <cell line: 7>() 5 #!pip install git+https://github.com/matjesg/deepflash2.git@master 6 import deepflash2 ----> 7 from deepflash2.gui import GUI, _connect_to_drive 8 clear_output(wait=True) 9 display(HTML(f'Using deepflash2 version {deepflash2.version}'))

3 frames

/usr/local/lib/python3.10/dist-packages/deepflash2/data.py in RandomTileDataset() 427 n_inp = 1 428 def init(self, *args, sample_mult=None, flip=True, rotation_range_deg=(0, 360), scale_range=(0, 0), --> 429 albumentations_tfms=[A.RandomGamma()], min_length=400, *kwargs): 430 super().init(args, **kwargs) 431 store_attr('sample_mult, flip, rotation_range_deg, scale_range, albumentations_tfms')

AttributeError: 'functools.partial' object has no attribute 'RandomGamma'

How can the error be fixed? Bildschirmfoto vom 2024-06-03 18-43-21

matjesg commented 4 months ago

Hi @AscheJan , thanks for raising the issue. The error was due to some version mismatches in the dependencies and should be fixed in the current master.

I currently cannot update the deepflash2 version on pypi, but the notebook is now changed to use the gitub master instead of the pypi version.