simongraham / hovernet_inference

HoVer-Net inference code for simultaneous nuclear segmentation and classification
66 stars 19 forks source link

Code does not move past Processing Image bar and Out of Memory Errors #36

Closed talkhanz closed 3 years ago

talkhanz commented 3 years ago

As you can see in the output below, the code does not proceed past the processing image bar and even if does ,there is an out of memory error Running on a google colab gpu

output
simongraham commented 3 years ago

Hi @talkhanz ,

Are you running using wsi mode or tile mode? If you are using tile mode, please can you provide the dimensions of the input image.

talkhanz commented 3 years ago

I ran this code in the wsi mode

simongraham commented 3 years ago

Are you running with a TCGA image? Can you send the link to the image if you are and I will test it out

talkhanz commented 3 years ago

@simongraham I ran it in tile mode too and I ran into the same issue e.g stuck at processing image bar but if I press ctrl + C to interrupt , the program stops but i get the segmented output as overlay.png if I look into the output folder but this behavior does not yield in the wsi mode. And the wsi image is taken from the Cancer Imaging Archive and the link is https://portal.gdc.cancer.gov/legacy-archive/files/940944d9-e496-48dc-9541-42ea9295f8be

simongraham commented 3 years ago

Before I test with the WSI, let's clear up some things.

What image did you run with for tile mode? If you ran with tile mode, then the input should be a standard image file such as png or jpg. Was this done? If it was, then please provide the image dimensions.

When running with wsi mode, did you use the default configurations provided in the repository?

Can you try testing with a small image tile and using tile mode to see whether you still run into the same problem. Try using this sample image here.

talkhanz commented 3 years ago

in tile mode , i used a jpeg file with dimensions 1280 x 853. I will update on the sample image as soon as I am done Edit: I use the default parameters as listed in usage.ipynb The image used is inserted below image

talkhanz commented 3 years ago

I am attaching the script I run in case it helps segment_convert.zip

talkhanz commented 3 years ago

@simongraham I am able to get a segmented output file (although I did get "unable to allocate 6 gb ") error and here is the result from overlay.png overlay

simongraham commented 3 years ago

Okay so the image that i suggested to use works, but the image that you included does not work? i.e the image with dimensions 1280x853. Did you use the jpeg image with tile mode? If the code works with the image that I supplied then something else strange is going on.

One thing to note is that your image tile does not appear to be at 40x objective magnification. You should ensure that is the case.

For tile mode, we use opencv to read images - please also do a test to make sure you can read your own image tiles to make sure there is nothing wrong when reading jpeg images.

talkhanz commented 3 years ago

the .svs file is read successfully but as mentioned before , the code is stuck at the processing image stage. The 1280 x 853 jpeg was used with tile mode and it produces a segmented output (in the form of overlay.png) but only if I press ctrl + C to halt the program (after it gets stuck at the processing stage)

simongraham commented 3 years ago

To update you - I will look into this towards the end of the week

talkhanz commented 3 years ago

To update you - I will look into this towards the end of the week

I look forward to your update. in case it helps, my current gpu ram is 8gb. I hope that is suffiencient to run the code

simongraham commented 3 years ago

If the problem persists consider looking into the PyTorch version of the code.