brainstorm icon indicating copy to clipboard operation
brainstorm copied to clipboard

questions about evaluate_segmenters.py

Open WwwwJX opened this issue 3 years ago • 7 comments

Thank you very much for sharing the code. I have many questions about evaluate_segmenters.py. Could you tell me more details about how to run the evaluate_segmenters.py? And I can't find the src/losses, so I import the voxelmorph package. However I find I cannot find the binary_dice. So how can I do? And if I let the ds_key=mri-100unlabeled-test then will "IndexError: list index out of range" If I let the ds_key=mri-100unlabeled then will "KeyError: 'n_test'" Thanks for your help

WwwwJX avatar Dec 13 '21 16:12 WwwwJX

evaluate_segmenters.py is a script used only to compare the different segmentation models described in the paper; it is not necessary for training an augmented segmentation model.

Searching for "dice" in the voxelmorph repo, I see there is now this sample: https://github.com/voxelmorph/voxelmorph/blob/dev/scripts/tf/test.py

You should select a ds_key that refers to your desired dataset defined in main.py. mri-100unlabeled-test is the one that I used, but depending on how many test volumes you have, it may be looking for more volumes than what is available (that is what the IndexError sounds like but it is impossible for me to say what the issue is without knowing where the error is coming from).

xamyzhao avatar Dec 15 '21 19:12 xamyzhao

Sorry, I still don't know how to run the evaluate_segmenters.py. If I want use the mri-100unlabeled-test, how could I edit the code? Here is the errors image

WwwwJX avatar Dec 29 '21 14:12 WwwwJX

@xamyzhao Sorry to trouble you. I waste much time on the script but still dont know how to run it. Can you tell me more details about it?

WwwwJX avatar Jan 04 '22 12:01 WwwwJX

It seems like here, evaluate_segmenters is looking for test data to evaluate your trained segmentation networks on, and is not finding any training or testing data. How many .npz files do you have for training/testing?

xamyzhao avatar Jan 04 '22 20:01 xamyzhao

@xamyzhao I use the dataset you provided to train and test. I know I have to find new data to run the test script, but I want to run the script firstly. I input the --data mri-100unlabeled for train script, and I let the ds_key as mri-100unlabeled-test in the test script.

WwwwJX avatar Jan 05 '22 07:01 WwwwJX

The script is failing right now because it is not finding enough test volumes. If you look at https://github.com/xamyzhao/brainstorm/blob/4634c602881ebe5226c268a4d12488cc79fe2036/src/mri_loader.py#L124, the data loader is looking for 100 test volumes in a folder where you presumably have none.

xamyzhao avatar Jan 06 '22 05:01 xamyzhao

@xamyzhao Thank you very much. I modify the code you mentioned, and then I met this question. image

WwwwJX avatar Jan 06 '22 10:01 WwwwJX