From 326716781b807d81dcb8366dd08f5416a03a4834 Mon Sep 17 00:00:00 2001 From: David Novotny Date: Thu, 4 Aug 2022 11:10:48 -0700 Subject: [PATCH] - fail if CO3Dv2 path is not given even if path_manager is None Summary: ... see title Reviewed By: bottler Differential Revision: D38430103 fbshipit-source-id: fd0696da82c367b0f4d9c9d92c0cba0230834137 --- .../json_index_dataset_map_provider_v2.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pytorch3d/implicitron/dataset/json_index_dataset_map_provider_v2.py b/pytorch3d/implicitron/dataset/json_index_dataset_map_provider_v2.py index f17c2398..d38c4bf1 100644 --- a/pytorch3d/implicitron/dataset/json_index_dataset_map_provider_v2.py +++ b/pytorch3d/implicitron/dataset/json_index_dataset_map_provider_v2.py @@ -191,15 +191,17 @@ class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13] if path_manager is not None: path_managed_frame_file = path_manager.get_local_path(frame_file) - if not os.path.isfile(path_managed_frame_file): - # The frame_file does not exist. - # Most probably the user has not specified the root folder. - raise ValueError( - f"Looking for frame annotations in {path_managed_frame_file}." - + " Please specify a correct dataset_root folder." - + " Note: By default the root folder is taken from the" - + " CO3DV2_DATASET_ROOT environment variable." - ) + else: + path_managed_frame_file = frame_file + if not os.path.isfile(path_managed_frame_file): + # The frame_file does not exist. + # Most probably the user has not specified the root folder. + raise ValueError( + f"Looking for frame annotations in {path_managed_frame_file}." + + " Please specify a correct dataset_root folder." + + " Note: By default the root folder is taken from the" + + " CO3DV2_DATASET_ROOT environment variable." + ) # setup the common dataset arguments common_dataset_kwargs = getattr(self, f"dataset_{self.dataset_class_type}_args")