-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got only 0s and 1s in segmentation output #652
Comments
Hi Emilia! If I'm reading your logs correctly, it looks like you are running deepcell 0.10.0. Is that right? Could you try running the latest version of deepcell (0.12.4) and let us know if you see the same problems? It would be helpful if you could show us the output of
|
Hi Morgan! Thank you for the suggestions. I ran the 0.12.4 version with the same code and same environment but still have the same issues - 1) only 0s and 1s in the whole-cell segmentation and 2) segmentation fault when I tried to do nuclear segmentation. I didn't get the warning about Regarding the segmentation fault, I unfortunately don't think I could get more information out of it either. I have attached my We have also been thinking what could have caused this, just wanted to pass along this observation in case it was of any use. So could it be that certain packages that Mesmer calls use a 32-bit system? Might be a coincidence, but the largest image we were able to run was ~32k by 32k. If each pixel's memory address was stored in 16-bit and we normalize by 2^31, the largest signed number that a 32-bit system could sore, then Thanks again! Let us know if there are other tests that we could do to help diagnose the issue. Error log
output log
run_Mesmer_ultivue_0.12.4.py
Output of
|
Thanks @EmiliaCXY for the updated info:
Thanks for trying the latest version. There's nothing immediately obvious that points to a specific culprit.
Segmentation faults are notoriously tricky to track down "/. In the absence of a self-contained reproducible example, it will be difficult to assist here. If there is e.g. a single image which causes these problems which you are able to share, I may be able to take a closer look. If not, the next thing I would try would be attempting to run the example with a debugger like
It's an interesting idea - as long as you're not running on a 32-bit system (which likely isn't even possible, given the dependency tree) this is unlikely to be the issue. Something to keep in mind though!
Thanks for this - it seems that this is not picking up the correct environment? Note e.g. that |
I would suggest running the model on a very small crop (1024x1024) of your input image to make sure the memory/large image problems can be separated from the 0s and 1s. I would also run the model in your environment on one image from the example dataset in the Mesmer notebook to further track down where the issue is coming from |
Thanks @rossbar and @ngreenwald!! We really appreciate it! Sorry, see below for the pip list output from within the singularity container. We've had other images that we were able to run mesmer successfully, so I think the environment is set up correctly. We'd be happy to share an image with you! We can share a link with you to download the data from. Are rbarnowski@caltech, nfgreen@stanford, msschwartz@caltech the right emails to reach you? Thank you for looking into this!
|
Hi Noah, Ross, and Morgan! Just wanted to update that I ran v0.12.4 on a small patch (2048 * 2048) of the whole slide image and it was able to segment nicely (both whole cell and nuclear), so the environment and the input image should be okay. Below is a screenshot overlaying the nuclear channel input and the whole cell segmentation mask. |
And this is a small crop of the same image that was initially giving you the issues? Sounds like it's definitely related to the large image size. Perhaps it's on the verge of a seg fault? The first result is the malformed output, and the second is an actual segfault when you call the model again? |
Hi @ngreenwald! Yes the segmentation mask above is on a small crop of the same image. So when I inputted the whole image to mesmer and did whole cell segmentation, the segmentation mask was all 0s and 1s. And then I got a seg fault when I called mesmer again on the same image to do nuclear segmentation. |
Yeah, have to admit I'm a bit stumped on this one. We've had people process large images without issues before. Not sure what the root cause is here. |
Thank you for all the suggestions and thoughts though! We really really appreciate it. Would you or @rossbar potentially be able to test our image on your server? We can provide the input membrane-nuclear two-channel tiff file that I referenced here and the exact code I used. We have tried processing large images through mesmer on two of our HPC servers and ran into the same issue, so it'd be nice to see if this is reproducible on your side. But no worries if you don't have the bandwidth and we will tile our images as a workaround. Thanks a lot again! |
We're looking into having more seamless support for large images. It'll require some updates, so I would suggest moving forward with tiled processing in the meantime. If you pick large-ish tiles, you shouldn't end up having too many boundaries to worry about. Thanks for bringing this up! If you run into any other issues specific to large images, definitely let us know |
@EmiliaCXY if you have a secure way of sharing the input data that's causing these problems, I'd be happy to take a look. |
@rossbar Thank you!! We can share the input file via SFTP. |
@EmiliaCXY in the interest of minimizing the number of places my contact info is posted, please refer to my github profile page! |
Hello!
I was running Mesmer to segment whole tumor images (~36k by 42k pixels) on an M60 GPU and I asked for 450G RAM. I have a few questions below and would appreciate any input. (Also I've tried other GPUs and had the same issues.)
So the code I used was
segmentation_predictions = app.predict(X_train, image_mpp=0.5)
.1. Mesmer was able to finish whole-cell segmentation, however, all predicted cells were labelled with 1s.
Here's a screenshot of how the segmentation mask:
The output of
np.unique(segmentation_predictions[0,:,:,0], return_counts = True)
was just{0: 1128105591, 1: 433044321}
Also, I got a warning -
UserWarning: Only one label was provided to 'remove_small_objects'. Did you mean to use a boolean array?
. This is a new warning compared to my other successful runs, so I was wondering if you have any insights about what might have caused all cells to get labelled as 1 and how to address it. I also attached the entire output prints at the end in case any of it is useful.2 . I got a segmentation fault when I tried to run nuclear segmentation on the same image.
This is the code I used:
segmentation_predictions_nuc = app.predict(X_train, image_mpp=0.5, compartment='nuclear')
See the end for the entire error message print. Was there a reason why the code was able to finish on whole-cell segmentation but threw errors on nuclear segmentation?3. I saw the posts #628 and #582 about segmenting large images and agreed that using a series of overlapping patches of 20k by 20k could be a workaround. I was curious if handling large images could be something that Mesmer handles internally?
Thank you so much for your time and efforts!
Error log related to Q1 above:
Error log related to Q2 above:
The text was updated successfully, but these errors were encountered: