In a nutshell, I use the following code to generate prediction dice scores for a test set (consists of 90 samples) and saved in a file called predict.pt.
preds, _ = learn.get_preds(ds_type=DatasetType.Test)
torch.save(preds, 'preds.pt')
Now I want to change the preds.pt file into a zip file by each sample. How can I do this?
This is a part of the MICCAI challenge, not Kaggle. I copy-pasted the rules just in case.
Predictions should be submitted as a zip (
predictions.zip
) archive of.nii.gz
files namedprediction_00210.nii.gz, ..., prediction_00299.nii.gz
corresponding to the ordered list of 90 test cases. That is, you should generate each of these prediction files in a particular directory, and then from that directory, run the following command:
zip predictions.zip prediction_*.nii.gz