diff --git a/comparisons/DeepLabV3+/train_deeplabv3_res50.py b/comparisons/DeepLabV3+/train_deeplabv3_res50.py index cc683dc2..a235d10a 100755 --- a/comparisons/DeepLabV3+/train_deeplabv3_res50.py +++ b/comparisons/DeepLabV3+/train_deeplabv3_res50.py @@ -75,7 +75,7 @@ def __len__(self): def __getitem__(self, index): img_name = os.path.basename(self.gt_path_files[index]) - assert img_name == os.path.basename(self.gt_path_files[index]), 'img gt name error' + self.gt_path_files[index] + self.npy_files[index] + assert img_name == os.path.basename(self.gt_path_files[index]), 'img gt name error: img=' + join(self.img_path, img_name) + ' gt=' + self.gt_path_files[index] img_3c = np.load(join(self.img_path, img_name), 'r', allow_pickle=True) # (H, W, 3) resize_img_cv2 = cv2.resize( img_3c, diff --git a/extensions/point_prompt/train_point_prompt.py b/extensions/point_prompt/train_point_prompt.py index 8b4c7639..dda7a96f 100644 --- a/extensions/point_prompt/train_point_prompt.py +++ b/extensions/point_prompt/train_point_prompt.py @@ -120,7 +120,7 @@ def __len__(self): def __getitem__(self, index): img_name = os.path.basename(self.gt_path_files[index]) - assert img_name == os.path.basename(self.gt_path_files[index]), 'img gt name error' + self.gt_path_files[index] + self.npy_files[index] + assert img_name == os.path.basename(self.gt_path_files[index]), 'img gt name error: img=' + join(self.img_path, img_name) + ' gt=' + self.gt_path_files[index] img_1024 = np.load(join(self.img_path, img_name), 'r', allow_pickle=True) # (H, W, 3) # convert the shape to (3, H, W) img_1024 = np.transpose(img_1024, (2, 0, 1)) # (3, 256, 256) diff --git a/extensions/text_prompt/train_text_prompt.py b/extensions/text_prompt/train_text_prompt.py index 3d4383f5..948c6117 100644 --- a/extensions/text_prompt/train_text_prompt.py +++ b/extensions/text_prompt/train_text_prompt.py @@ -139,7 +139,7 @@ def __len__(self): def __getitem__(self, index): img_name = basename(self.gt_path_files[index]) - assert img_name == basename(self.gt_path_files[index]), 'img gt name error' + self.gt_path_files[index] + self.npy_files[index] + assert img_name == basename(self.gt_path_files[index]), 'img gt name error: img=' + join(self.img_path, img_name) + ' gt=' + self.gt_path_files[index] img_1024 = np.load(join(self.img_path, img_name), 'r', allow_pickle=True) # (H, W, 3) # convert the shape to (3, H, W) img_1024 = np.transpose(img_1024, (2, 0, 1)) # (3, 256, 256) diff --git a/train_multi_gpus.py b/train_multi_gpus.py index a7155457..9034e9b2 100755 --- a/train_multi_gpus.py +++ b/train_multi_gpus.py @@ -82,7 +82,7 @@ def __getitem__(self, index): self.gt_path_files[index], "r", allow_pickle=True ) # multiple labels [0, 1,4,5...], (256,256) assert img_name == os.path.basename(self.gt_path_files[index]), ( - "img gt name error" + self.gt_path_files[index] + self.npy_files[index] + "img gt name error: img=" + join(self.img_path, img_name) + " gt=" + self.gt_path_files[index] ) label_ids = np.unique(gt)[1:] gt2D = np.uint8( diff --git a/train_one_gpu.py b/train_one_gpu.py index cb325c1a..f15e0895 100755 --- a/train_one_gpu.py +++ b/train_one_gpu.py @@ -89,7 +89,7 @@ def __getitem__(self, index): self.gt_path_files[index], "r", allow_pickle=True ) # multiple labels [0, 1,4,5...], (256,256) assert img_name == os.path.basename(self.gt_path_files[index]), ( - "img gt name error" + self.gt_path_files[index] + self.npy_files[index] + "img gt name error: img=" + join(self.img_path, img_name) + " gt=" + self.gt_path_files[index] ) label_ids = np.unique(gt)[1:] gt2D = np.uint8(