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

fix: make sure that a custom output folder for cv results is empty #2269

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

mzenk
Copy link
Member

@mzenk mzenk commented Jun 7, 2024

Issue:
When using nnUNetv2_accumulate_crossval_results and specifying an existing output folder with argument -o, the specified folder is first deleted completely and re-created before CV results are saved in it. This is unexpected behavior and might need to undesired data loss.

Fix:
Require the directory specified with -o to be non-existent or empty.

Comment on alternative solution:
Another option would be to remove the shutil.rmtree in nnunetv2/evaluation/accumulate_cv_results.py, but this would affect the case where -o is not specified in the nnUNetv2_accumulate_crossval_results entrypoint. To keep the changes minimal, the rmtree command is kept as is.

@FabianIsensee
Copy link
Member

Good find, much appreciated!

@FabianIsensee FabianIsensee merged commit 1cc001f into MIC-DKFZ:master Jun 7, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants