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

Something trouble with inference.py #11

Open
JinxLv opened this issue Sep 10, 2020 · 4 comments
Open

Something trouble with inference.py #11

JinxLv opened this issue Sep 10, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@JinxLv
Copy link

JinxLv commented Sep 10, 2020

Hello!
I have trained a segmentation model using my own datasets,there is nothing wrong with my valuation dataset and the dice is high.But when I use the 'non_overlap_padding' fuction in the inference.py ,the dice score is very low.I have tried to output the prediction image (image bellow),there might something wrong with the patches index.Would you mind help me to fix this problem?Thank you very much !

13

@iliasprc
Copy link
Collaborator

Hello OldDriverJinx . We are conducting further experiments in order to correctly evaluate the whole medical image during inference. Non_overlap_padding function is still under development, we are trying to figure some issues.
Could you provide some more details about the model and the dataset you used ?

@iliasprc iliasprc added the help wanted Extra attention is needed label Sep 10, 2020
@JinxLv
Copy link
Author

JinxLv commented Sep 10, 2020

Hello OldDriverJinx . We are conducting further experiments in order to correctly evaluate the whole medical image during inference. Non_overlap_padding function is still under development, we are trying to figure some issues.
Could you provide some more details about the model and the dataset you used ?

Thanks for your reply! I have used my own brain segmentation dataset (like the MRBrains18) to train the 3DUnet.I found that there is nothing wrong with this function when my input is the full image(256256256),and this is the prediction image
image
.But when I want to predict in patches,I meet the problem which I have mentioned above.The same problem appears in function 'visualize_3D_no_overlap_new'.Could you please give me some suggestions to fix it?Thanks a lot !

@JinxLv
Copy link
Author

JinxLv commented Sep 11, 2020

Hello OldDriverJinx . We are conducting further experiments in order to correctly evaluate the whole medical image during inference. Non_overlap_padding function is still under development, we are trying to figure some issues.
Could you provide some more details about the model and the dataset you used ?

I have found the solution.Just add output = output.permute(1,0,2,3,4).contiguous() at line 78 in "viz.py" like this:

# Reshape backlist 
output = output.permute(1,0,2,3,4).contiguous()
output_unfold_shape = unfold_shape[1:] 
output_unfold_shape.insert(0, Classes) 

Now the output seems to be normal.

@ghost
Copy link

ghost commented Jul 9, 2022

Can you share you inference code? The official reasoning code doesn't seem to be used directly, I'm a novice and won't modify it, this is my email 2434196708@qq.com,thank you ! ! !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants