matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.67k stars 11.71k forks source link

error in processing image #899

Open umair-sabir opened 6 years ago

umair-sabir commented 6 years ago

Hi, I used surgery.py file for running mask rcnn on two classes. The file can be found on the link below: https://github.com/SUYEgit/Surgery-Robot-Detection-Segmentation/blob/master/surgery.py

This surgery robot detection method uses two classes "arm" and "ring". I just replaced the two class name with my class name "yes" and "no" in the surgery.py file. But i start to train my model. It gives me the following error.

mrcnn_mask (TimeDistributed) /home/hdfsf16/.conda/envs/mask/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py100 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/hdfsf16/.conda/envs/mask/lib/python3.5/site-packages/keras/engine/training.py:1987: 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 withuse_multiprocessing=True`' ERROR:root:Error processing image {'width': 1280, 'id': '15691.png', 'names': [{'type': 'yes'}], 'source': 'type', 'height': 1024, 'polygons': [{'all_points_y': [647, 648, 657, 657, 669, 666, 657, 652, 640, 615, 619, 641, 647], 'name': 'polygon', 'all_points_x': [661, 676, 686, 700, 695, 658, 651, 651, 653, 647, 658, 660, 661]}], 'path': 'data/surgery/train/15691.png'} Traceback (most recent call last): File "/home/hdfsf16/.conda/envs/mask/Surgery-Robot-Detection-Segmentation-master/Surgery-Robot-Detection-Segmentation-master/mrcnn/model.py", line 1696, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/hdfsf16/.conda/envs/mask/Surgery-Robot-Detection-Segmentation-master/Surgery-Robot-Detection-Segmentation-master/mrcnn/model.py", line 1210, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "surgery.py", line 164, in load_mask class_names = info["type"] KeyError: 'type' ERROR:root:Error processing image {'width': 1280, 'id': '2103.png', 'names': [{'type': 'yes'}], 'source': 'type', 'height': 1024, 'polygons': [{'all_points_y': [661, 655, 651, 645, 639, 648, 657, 661], 'name': 'polygon', 'all_points_x': [657, 669, 685, 669, 650, 646, 646, 657]}], 'path': 'data/surgery/train/2103.png'} Traceback (most recent call last): File "/home/hdfsf16/.conda/envs/mask/Surgery-Robot-Detection-Segmentation-master/Surgery-Robot-Detection-Segmentation-master/mrcnn/model.py", line 1696, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/home/hdfsf16/.conda/envs/mask/Surgery-Robot-Detection-Segmentation-master/Surgery-Robot-Detection-Segmentation-master/mrcnn/model.py", line 1210, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "surgery.py", line 164, in load_mask class_names = info["type"] KeyError: 'type

chrigui94 commented 5 years ago

Have you solved this problem, I have the same error ?