diff --git a/compressai/datasets/image.py b/compressai/datasets/image.py index 4b6de77c..6f40967f 100644 --- a/compressai/datasets/image.py +++ b/compressai/datasets/image.py @@ -61,7 +61,7 @@ def __init__(self, root, transform=None, split="train"): splitdir = Path(root) / split if not splitdir.is_dir(): - raise RuntimeError(f'Invalid directory "{root}"') + raise RuntimeError(f'Missing directory "{splitdir}"') self.samples = sorted(f for f in splitdir.iterdir() if f.is_file()) diff --git a/compressai/datasets/video.py b/compressai/datasets/video.py index f1ae65e2..a828845c 100644 --- a/compressai/datasets/video.py +++ b/compressai/datasets/video.py @@ -27,7 +27,6 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - import random from pathlib import Path @@ -91,10 +90,10 @@ def __init__( splitdir = Path(f"{root}/sequences") if not splitfile.is_file(): - raise RuntimeError(f'Invalid file "{root}"') + raise RuntimeError(f'Missing file "{splitfile}"') if not splitdir.is_dir(): - raise RuntimeError(f'Invalid directory "{root}"') + raise RuntimeError(f'Missing directory "{splitdir}"') with open(splitfile, "r") as f_in: self.sample_folders = [Path(f"{splitdir}/{f.strip()}") for f in f_in]