MontaEllis / Pytorch-Medical-Segmentation

This repository is an unoffical PyTorch implementation of Medical segmentation in 2D and 3D.
MIT License
860 stars 196 forks source link

validation transform is not applied #6

Closed SeanCho1996 closed 3 years ago

SeanCho1996 commented 3 years ago

Hi there,

I found your work very inspiring, and I made my own segmentation model follwing your idea. But I found a problem in the validation step.

In your main.py file, line 456:

for i,subj in enumerate(test_dataset.subjects):
...

I think in the enumerate parentheses, it should not be test_dataset.subjects because the the subjects object is the raw image list without preprocessing (aka transforms in the data_function.py). Maybe here should be:

for i,subj in enumerate(test_dataset.valid_set):
...

Because valid_set(also there may be a typo that you use training_set in test_loader) is the one with transforms(normalization) applied.

Maybe my comprehension is not correct and you have your own thoughts, so could you please share your idea on this step? Thank u

MontaEllis commented 3 years ago

Thank you for your reply. Please check: https://github.com/MontaEllis/Pytorch-Medical-Segmentation/blob/1b190be70efc78e19441f1353e90d7b61462d1b0/main.py#L457 I have used normalisation here, aka transform.