-
Notifications
You must be signed in to change notification settings - Fork 684
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
Raising RuntimeErrors when datasets missing #2430
Conversation
torchaudio/datasets/cmuarctic.py
Outdated
@@ -120,7 +120,12 @@ def __init__( | |||
checksum = _CHECKSUMS.get(url, None) | |||
download_url_to_file(url, archive, hash_prefix=checksum) | |||
extract_archive(archive) | |||
|
|||
else: | |||
if not os.path.exists(archive): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it assumes download
is False
, and archive
is not found. If users extracted the files to self._path
and deleted the archive, it should not throw a runtime error.
We can change the archive
to self._path
as a workaround.
torchaudio/datasets/cmuarctic.py
Outdated
"The file is not found in the following location. " | ||
f"Set `download=True` to download it. {archive}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be rephrased like this:
"The file is not found in the following location. " | |
f"Set `download=True` to download it. {archive}" | |
f"The path {self._path} doesn't exist." | |
"Please check the ``root`` path or set `download=True` to download it" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@skim0514 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Checks download flag and raises error when dataset is missing given download flag exists. Unit tested manually.
edit: Changed path to check as well as comment that is returned.