Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

IndexError: index -1 is out of bounds for axis 2 with size 0image_id 5

Open wanshuchun opened this issue 6 years ago • 2 comments

/home/w/anaconda3/lib/python3.6/site-packages/tensorflow-1.12.0-py3.6-linux-x86_64.egg/tensorflow/python/ops/gradients_impl.py:112: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " /home/w/anaconda3/lib/python3.6/site-packages/Keras-2.2.4-py3.6.egg/keras/engine/training_generator.py:47: UserWarning: Using a generator with use_multiprocessing=True and multiple workers may duplicate your data. Please consider using thekeras.utils.Sequence class. UserWarning('Using a generator with use_multiprocessing=True`' Epoch 1/10 image_id 54 ERROR:root:Error processing image {'id': 54, 'source': 'shapes', 'path': 'train_data/pic/25.png', 'width': 1920, 'height': 1080, 'mask_path': 'train_data/cv2_mask/25.png', 'yaml_path': 'train_data/labelme_json/25_json/info.yaml'} Traceback (most recent call last): File "/home/w/Mask_RCNN/mrcnn/model.py", line 1710, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/w/Mask_RCNN/mrcnn/model.py", line 1213, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "train.py", line 152, in load_mask occlusion = np.logical_not(mask[:, :, -1]).astype(np.uint8) IndexError: index -1 is out of bounds for axis 2 with size 0 image_id 22 ERROR:root:Error processing image {'id': 22, 'source': 'shapes', 'path': 'train_data/pic/75.png', 'width': 1920, 'height': 1080, 'mask_path': 'train_data/cv2_mask/75.png', 'yaml_path': 'train_data/labelme_json/75_json/info.yaml'} Traceback (most recent call last): File "/home/w/Mask_RCNN/mrcnn/model.py", line 1710, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/w/Mask_RCNN/mrcnn/model.py", line 1213, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "train.py", line 152, in load_mask occlusion = np.logical_not(mask[:, :, -1]).astype(np.uint8) IndexError: index -1 is out of bounds for axis 2 with size 0 image_id 54 ERROR:root:Error processing image {'id': 54, 'source': 'shapes', 'path': 'train_data/pic/25.png', 'width': 1920, 'height': 1080, 'mask_path': 'train_data/cv2_mask/25.png', 'yaml_path': 'train_data/labelme_json/25_json/info.yaml'} Traceback (most recent call last): File "/home/w/Mask_RCNN/mrcnn/model.py", line 1710, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/w/Mask_RCNN/mrcnn/model.py", line 1213, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "train.py", line 152, in load_mask occlusion = np.logical_not(mask[:, :, -1]).astype(np.uint8) IndexError: index -1 is out of bounds for axis 2 with size 0image_id 54 ERROR:root:Error processing image {'id': 54, 'source': 'shapes', 'path': 'train_data/pic/25.png', 'width': 1920, 'height': 1080, 'mask_path': 'train_data/cv2_mask/25.png', 'yaml_path': 'train_data/labelme_json/25_json/info.yaml'} Traceback (most recent call last): File "/home/w/Mask_RCNN/mrcnn/model.py", line 1710, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/w/Mask_RCNN/mrcnn/model.py", line 1213, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "train.py", line 152, in load_mask occlusion = np.logical_not(mask[:, :, -1]).astype(np.uint8) IndexError: index -1 is out of bounds for axis 2 with size 0image_id 5

wanshuchun avatar Jan 04 '19 06:01 wanshuchun

你好,请问这个问题怎么解决的? Hello, how is this problem solved? I also ran into this problem.

SJelly123 avatar Sep 07 '22 01:09 SJelly123

I just fixed this problem, the reason is my datasets contains bad data, pic doesnot match with json file after augmentation(resize and move pic makes gt data of json file out of image region)

SJelly123 avatar Sep 07 '22 02:09 SJelly123