Skip to content
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

About ZeroDivisionError when I run MIL_train.py #16

Open
ghost opened this issue Oct 27, 2021 · 3 comments
Open

About ZeroDivisionError when I run MIL_train.py #16

ghost opened this issue Oct 27, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 27, 2021

"dataPrepare_for_CNN.py" is okay
but
when I run the "MIL_train.py",
there is a error:

return running_loss/len(loader.dataset)
ZeroDivisionError: float division by zero

So sad that I cannot solve this error, please help me

@gabricampanella
Copy link
Collaborator

Difficult to say exactly what is wrong. But it definitely has to do with how the data is set up. The script assumes you are loading a dictionary and it is expecting particular keys as I describe in the README file. To give you more help I would need to see this dataPrepare_for_CNN.py script, or see the contents of the data dictionary.

@ghost
Copy link
Author

ghost commented Oct 28, 2021

sorry for forgetting that, the dataPrepare_for_CNN.py is coding by another one, he had implemented your work.

https://github.com/TankZhouFirst/clinical-grade-computational-pathology-using-weakly-supervised-deep-learning-on-whole-slide-images/blob/master/code/dataPrepare_for_CNN.py
image
image
image
image

It's a little difficult to put the whole code on the issue, so I made a screenshot.
It seems it could get some data which need in MIL.
hope this will give you more information, and thanks again for your help!
Sincerely,
mingxin.

@qiyueliuhuo23
Copy link

I am also reproducing the code of this paper recently. Have you solved the problem you encountered? If you have solved the problem, please let me know how to solve it. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants