Skip to content

Error when download=True  #8668

@Navoditamathur

Description

@Navoditamathur

🚀 The feature

Proposed Solution:
I propose adding an interactive confirmation prompt when the dataset directory already exists. Instead of raising an error, the library would prompt the user with:

The dataset directory already exists. Do you want to replace it? (Y/N):
If the user inputs "Y", the existing dataset would be replaced with a fresh download.
If the user inputs "N", the download would be skipped, and the existing dataset would remain untouched, allowing the process to continue without errors.

Motivation, pitch

Current Issue:
When using torchvision.datasets with download=True, if the dataset directory already exists, an error is raised, and the process is halted. This behavior can be disruptive, especially when users may want the option to redownload or replace the existing dataset.

Benefits:
Improved User Control: Users can decide whether they want to redownload the dataset or keep the existing one without experiencing an unexpected error.
Streamlined Workflow: This feature would eliminate the need for users to manually delete the existing dataset directory to avoid errors, simplifying the workflow.
Error Prevention: By preventing abrupt failures, this feature would improve the robustness of code that relies on torchvision.datasets for data handling.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions