You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the nice software. I trained a model in the GUI and I was trying to now use a jupyter notebook to apply it to multiple images. I tried following the tutorial notebooks, and the model was running fine, but when I ran io.masks_flows_to_seg, I did not see any seg npy files. I'm using python 3.8.19 on windows and cellpose version 3.0.7.
I believe the above line is the issue. imgs_restore=None but then [] * len(masks) always equals an empty list [] of len 0 (even though something like [None] * len(masks) would return a list of lists of len(masks)). This causing the enumerate command on line 501 to fail silently and no .npy
I believe the same error is also in the test test_cyto2_to_seg which at the moment might also return without error but does not save the seg npy files.
I think changing the offending line to imgs_restore = [[] for _ in masks] might work.
The same error doesn't affect the GUI, which uses the _save_sets function instead.
As a reference one can see the differences in the following lines:
n=3masks= [1] *nr1= [] *nr2= [None] *n# nothing is printed since r1 is len 0fori, vinenumerate(zip(masks, r1)):
print(i, r1)
# prints 1, 2, 3fori, vinenumerate(zip(masks, r2)):
print(i, r2)
The text was updated successfully, but these errors were encountered:
davidhbrann
changed the title
io.masks_flows_to_seg errors silently without saving seg npy file
io.masks_flows_to_seg errors silently without saving seg npy file [BUG]
Mar 28, 2024
I may have encoutered the same type of behavior for io.save_rois, empty zips. Either that or segmentation that was working on 2.2.3 stopped working on v3
Thanks for the nice software. I trained a model in the GUI and I was trying to now use a jupyter notebook to apply it to multiple images. I tried following the tutorial notebooks, and the model was running fine, but when I ran
io.masks_flows_to_seg
, I did not see any seg npy files. I'm using python 3.8.19 on windows and cellpose version 3.0.7.cellpose/cellpose/io.py
Line 499 in 509ffca
I believe the above line is the issue.
imgs_restore=None
but then[] * len(masks)
always equals an empty list[]
of len 0 (even though something like[None] * len(masks)
would return a list of lists oflen(masks)
). This causing the enumerate command on line 501 to fail silently and no.npy
cellpose/cellpose/io.py
Line 501 in 509ffca
I believe the same error is also in the test
test_cyto2_to_seg
which at the moment might also return without error but does not save the seg npy files.I think changing the offending line to
imgs_restore = [[] for _ in masks]
might work.The same error doesn't affect the GUI, which uses the
_save_sets
function instead.As a reference one can see the differences in the following lines:
(sorry, just noticed this is a duplicate of #894)
The text was updated successfully, but these errors were encountered: