-
Notifications
You must be signed in to change notification settings - Fork 20
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
Crash when using normalizers.MacenkoNormalizer(backend='torch') #55
Comments
Hello, @RECranston! :] I think the owners of this repo have archived it. At least it is no longer being maintained. So I can't merge any fixes if we find a bug. So, let's hope it is just a pytorch version issue. Which pytorch version are you using? Could you try downgrading it? |
Hi @andreped Thank you for your speedy reply! :)
Thanks very much for your help |
At least try that first. As no one has reported this issue before, I assume there is something wrong with your setup. Then again, if newer pytorch versions are no longer compatible, it would be great if the maintainers updated torchstain as well. |
Hi @andreped Thanks for your reply. I will give this a go with a few versions and get back to you. Appreciate your help with this! |
@RECranston Also, I assumed you tried using the exact image in the example with the algorithm? If that does not work, there is some local setup issue. EDIT: Lastly, if changing PyTorch version does not fix you issue. Could you try running this exact example in Google CoLab, just to sanity check that there is not something very wrong in the code? |
Hi @andreped I've tried running the following downgraded versions and I'm still getting the same error. Strangely I'm not able to run the example in colab as it is unable to find the downloaded files for some reason (despite the right file paths) Sorry I realise this is not much help |
Oh, the last point there is quite key. So the tool works fine but it fails on some images. That's due to the numerical instabilities of the algorithm. If there is an image that lacks colours similar to HE, for instance an image with just glass, the algorithm might fail. To fix, when looping across all image, do a try-except and skip images that fail to convert as these are images you do not care for regardless. I made a tool for this, which is based on torchstain. That way you can normalize all your patches quite easily: |
Hi @andreped Thanks so much for your help with this. I'll add in some try-except blocks and also check out fast-stain-normalization too! |
@RECranston As the issue seemed to be on improper usage of the tool on suboptimal images, and not really a bug in the code, then it would be great if you could close this issue :] Feel free to open a new ticket, if you have other issues! Otherwise, good luck! |
Will do! I've checked out the problem images again and one has a low tissue to background ratio and the other looks like a bad scan so this explanation makes sense. Thanks for your help - closing the issue now :) |
Hi there
I'm running into an issue when normalising 2 of my images when running normalizers.MacenkoNormalizer(backend='torch')
I am running the following code:
It's crashing on the last line with the error
I've tried it on each patch from this image (0x0,0x1,1x0,1x1) and have get the same error returned. I'm quite new to python so apologies in advance if this is a basic question.
I've also tried this workflow using tensorflow as the backend (as in issue #37 ) but it also crashes.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: