brainstorm
brainstorm copied to clipboard
questions about evaluate_segmenters.py
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
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).
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
@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?
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 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.
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
Thank you very much. I modify the code you mentioned, and then I met this question.