datasets_download try/catching the git-lfs prune for versions that do not support -f #2375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a try/catch in the
datasets_download.py
script around thegit lfs prune -f --recent
call to re-run the command without the-f
switch. While users can specify--no-prune
in the data loader command, that workaround should not be necessary.Motivation and Context
Some common git-lfs versions (e.g., 2.9.2 which Ubuntu 20.04 runs) do not support the -f flag on
git lfs prune
. This change wraps thegit lfs prune -f --recent
call in a try/catch for compatibility and a simpler user experience. Issue #2172 asks about this.How Has This Been Tested
I tested loading a dataset using git-lfs version 2.9.2, which previously broke due to the assumed
-f
switch. I used the command:python -m habitat_sim.utils.datasets_download --uids rearrange_task_assets --data-path data
Types of changes
Checklist