Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnair1 committed Nov 29, 2021
1 parent cc80b87 commit d854df8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions torchgeo/datasets/spacenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def __init__(
if to_be_downloaded:
if not download:
raise RuntimeError(
"Dataset not found. You can use download=True to download it."
f"Dataset not found in `root={self.root}` and `download=False`, "
"either specify a different `root` directory or use "
"`download=True` to automaticaly download the dataset."
)
else:
self._download(to_be_downloaded, api_key)
Expand Down Expand Up @@ -1071,7 +1073,9 @@ def __init__(
if to_be_downloaded:
if not download:
raise RuntimeError(
"Dataset not found. You can use download=True to download it."
f"Dataset not found in `root={self.root}` and `download=False`, "
"either specify a different `root` directory or use "
"`download=True` to automaticaly download the dataset."
)
else:
self._download(to_be_downloaded, api_key)
Expand Down

0 comments on commit d854df8

Please sign in to comment.