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

Error in opening pdf and labels #16

Closed shub2k closed 3 years ago

shub2k commented 3 years ago

Hi there , thanx for this wonderful library i am getting this error is it because of the directory management i think , i have a dataset of masks where i have sampled it to pdf and the labels but they are on separate directory but have a same root folder , i am not able to create a tiledataset using your RandomTileDataset or TileDataset the path that i am using is '/content/masks_scale2/' and it has two sub folders labels and pdf

/usr/local/lib/python3.7/dist-packages/deepflash2/data.py in _read_msk(path, n_classes, instance_labels, kwargs) 268 msk = tifffile.imread(path, kwargs) 269 else: --> 270 msk = imageio.imread(path, **kwargs) 271 if not instance_labels: 272 if np.max(msk)>n_classes:

/usr/local/lib/python3.7/dist-packages/imageio/core/functions.py in imread(uri, format, kwargs) 219 220 # Get reader and read first --> 221 reader = read(uri, format, "i", kwargs) 222 with reader: 223 return reader.get_data(0)

/usr/local/lib/python3.7/dist-packages/imageio/core/functions.py in get_reader(uri, format, mode, **kwargs) 137 if format is None: 138 raise ValueError( --> 139 "Could not find a format to read the specified file " "in mode %r" % mode 140 ) ValueError: Could not find a format to read the specified file in mode 'i'

shub2k commented 3 years ago

Found the solution :- i was not using the correct file path :) Thanx for this wonderful library though !