Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

Error while training custom data set on Mask RCNN

Open sree369nidhi opened this issue 6 years ago • 19 comments

I used bottle.py to retrain on my custom dataset here is the exact code: !python bottle/bottle.py train --dataset=/content/Mask_RCNN/samples/bottle/dataset --weights=coco

Using TensorFlow backend. Weights: coco Dataset: /content/Mask_RCNN/samples/bottle/dataset Logs: /content/logs

Configurations: BACKBONE resnet101 BACKBONE_STRIDES [4, 8, 16, 32, 64] BATCH_SIZE 2 BBOX_STD_DEV [0.1 0.1 0.2 0.2] COMPUTE_BACKBONE_SHAPE None DETECTION_MAX_INSTANCES 100 DETECTION_MIN_CONFIDENCE 0.9 DETECTION_NMS_THRESHOLD 0.3 FPN_CLASSIF_FC_LAYERS_SIZE 1024 GPU_COUNT 1 GRADIENT_CLIP_NORM 5.0 IMAGES_PER_GPU 2 IMAGE_CHANNEL_COUNT 3 IMAGE_MAX_DIM 1024 IMAGE_META_SIZE 14 IMAGE_MIN_DIM 800 IMAGE_MIN_SCALE 0 IMAGE_RESIZE_MODE square IMAGE_SHAPE [1024 1024 3] LEARNING_MOMENTUM 0.9 LEARNING_RATE 0.001 LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0} MASK_POOL_SIZE 14 MASK_SHAPE [28, 28] MAX_GT_INSTANCES 100 MEAN_PIXEL [123.7 116.8 103.9] MINI_MASK_SHAPE (56, 56) NAME human NUM_CLASSES 2 POOL_SIZE 7 POST_NMS_ROIS_INFERENCE 1000 POST_NMS_ROIS_TRAINING 2000 PRE_NMS_LIMIT 6000 ROI_POSITIVE_RATIO 0.33 RPN_ANCHOR_RATIOS [0.5, 1, 2] RPN_ANCHOR_SCALES (32, 64, 128, 256, 512) RPN_ANCHOR_STRIDE 1 RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2] RPN_NMS_THRESHOLD 0.7 RPN_TRAIN_ANCHORS_PER_IMAGE 256 STEPS_PER_EPOCH 100 TOP_DOWN_PYRAMID_SIZE 256 TRAIN_BN False TRAIN_ROIS_PER_IMAGE 200 USE_MINI_MASK True USE_RPN_ROIS True VALIDATION_STEPS 50 WEIGHT_DECAY 0.0001

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:2139: The name tf.nn.fused_batch_norm is deprecated. Please use tf.compat.v1.nn.fused_batch_norm instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:4267: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:2239: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/array_ops.py:1475: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.where in 2.0, which has the same broadcast rule as np.where WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py:553: The name tf.random_shuffle is deprecated. Please use tf.random.shuffle instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/utils.py:202: The name tf.log is deprecated. Please use tf.math.log instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py:600: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version. Instructions for updating: box_ind is deprecated, use box_indices instead Loading weights /content/mask_rcnn_coco.h5 WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:190: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:197: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:203: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-10-24 12:43:23.228850: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz 2019-10-24 12:43:23.229737: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x19fa8bc0 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2019-10-24 12:43:23.229779: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2019-10-24 12:43:23.231966: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2019-10-24 12:43:23.314495: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.315434: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x19fa8d80 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2019-10-24 12:43:23.315465: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Tesla K80, Compute Capability 3.7 2019-10-24 12:43:23.315691: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.316378: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235 pciBusID: 0000:00:04.0 2019-10-24 12:43:23.316758: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0 2019-10-24 12:43:23.318138: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0 2019-10-24 12:43:23.319474: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10.0 2019-10-24 12:43:23.319873: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10.0 2019-10-24 12:43:23.321723: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10.0 2019-10-24 12:43:23.322925: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10.0 2019-10-24 12:43:23.326860: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2019-10-24 12:43:23.327012: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.327851: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.328504: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0 2019-10-24 12:43:23.328601: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0 2019-10-24 12:43:23.330412: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-10-24 12:43:23.330469: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0 2019-10-24 12:43:23.330510: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N 2019-10-24 12:43:23.330777: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.331843: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2019-10-24 12:43:23.332564: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0. 2019-10-24 12:43:23.332643: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10805 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7) WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:207: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:216: The name tf.is_variable_initialized is deprecated. Please use tf.compat.v1.is_variable_initialized instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:223: The name tf.variables_initializer is deprecated. Please use tf.compat.v1.variables_initializer instead.

Training network heads

Starting at epoch 0. LR=0.001

Checkpoint Path: /content/logs/human20191024T1243/mask_rcnn_human_{epoch:04d}.h5 Selecting layers to train fpn_c5p5 (Conv2D) fpn_c4p4 (Conv2D) fpn_c3p3 (Conv2D) fpn_c2p2 (Conv2D) fpn_p5 (Conv2D) fpn_p2 (Conv2D) fpn_p3 (Conv2D) fpn_p4 (Conv2D) In model: rpn_model rpn_conv_shared (Conv2D) rpn_class_raw (Conv2D) rpn_bbox_pred (Conv2D) mrcnn_mask_conv1 (TimeDistributed) mrcnn_mask_bn1 (TimeDistributed) mrcnn_mask_conv2 (TimeDistributed) mrcnn_mask_bn2 (TimeDistributed) mrcnn_class_conv1 (TimeDistributed) mrcnn_class_bn1 (TimeDistributed) mrcnn_mask_conv3 (TimeDistributed) mrcnn_mask_bn3 (TimeDistributed) mrcnn_class_conv2 (TimeDistributed) mrcnn_class_bn2 (TimeDistributed) mrcnn_mask_conv4 (TimeDistributed) mrcnn_mask_bn4 (TimeDistributed) mrcnn_bbox_fc (TimeDistributed) mrcnn_mask_deconv (TimeDistributed) mrcnn_class_logits (TimeDistributed) mrcnn_mask (TimeDistributed) WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/optimizers.py:793: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: 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. " /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: 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. " /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:424: 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. " WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:1033: The name tf.assign_add is deprecated. Please use tf.compat.v1.assign_add instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:1020: The name tf.assign is deprecated. Please use tf.compat.v1.assign instead.

/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py:49: UserWarning: Using a generator with use_multiprocessing=True and multiple workers may duplicate your data. Please consider using the keras.utils.Sequence class. UserWarning('Using a generator with use_multiprocessing=True`' WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/callbacks.py:1122: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/keras/callbacks.py:1125: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.

Epoch 1/10 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20191004_122811.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20191004_122811.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [2539, 2418, 2237, 2005, 1904, 1757, 1656, 1538, 1478, 1364, 1370, 1216, 1034, 883, 860, 930, 1024, 1122, 1283, 1495, 1636, 1666, 1830, 2069, 2354, 2529, 2623, 2848, 3023, 3275, 3671, 3983, 3997, 3976], 'all_points_y': [1474, 1585, 1585, 1417, 1474, 1384, 1421, 1364, 1226, 1155, 1065, 1095, 1132, 1045, 863, 715, 641, 608, 608, 551, 514, 386, 289, 232, 259, 302, 309, 215, 312, 275, 198, 178, 490, 1757]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3968 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20190313_185930.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/val/IMG_20190313_185930.jpg', 'width': 2000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3987, 3745, 3517, 3167, 3094, 2430, 2331, 2036, 1792, 1534, 1488, 1428, 1322, 1183, 1071, 902, 681, 489, 397, 476, 664, 774, 1025, 1134, 1260, 1339, 1491, 1531, 1567, 1620, 1752, 1904, 2149, 2172, 2238, 2314, 2354, 2380, 2552, 2628, 2704, 2926, 3098, 3329, 3593, 3874, 3980, 3990], 'all_points_y': [1666, 1517, 1597, 1600, 1537, 1560, 1517, 1683, 1593, 1286, 1121, 1038, 1038, 1180, 1144, 1164, 1174, 1041, 840, 645, 493, 486, 466, 519, 450, 403, 410, 446, 380, 374, 228, 175, 66, 106, 112, 86, 169, 188, 175, 215, 354, 433, 410, 473, 552, 793, 909, 929]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 2147 is out of bounds for axis 1 with size 2000 ERROR:root:Error processing image {'id': 'IMG_20181110_234904.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181110_234904.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [5, 208, 444, 3513, 3606, 3825, 3847, 3907, 3929, 4225, 4296, 4636, 4718, 4877, 5014, 5085, 4932, 4647, 4494, 4252, 3984, 3677, 3677, 3567, 3485, 3820, 3847, 4132, 4340, 4389, 4466, 4428, 4302, 4061, 3907, 3661, 3688, 3683, 4066, 4340, 4466, 4510, 4466, 4346, 2948, 2707, 2548, 2439, 5, 16, 449, 345, 329, 11], 'all_points_y': [378, 66, 5, 11, 148, 274, 329, 329, 241, 142, 181, 110, 164, 27, 258, 499, 1014, 1129, 1014, 1096, 1107, 1025, 1184, 1321, 1529, 1381, 1397, 1348, 1436, 1567, 1808, 2006, 2082, 2197, 2170, 2170, 2395, 2450, 2581, 2756, 3096, 3381, 3639, 3858, 3874, 3754, 3754, 3852, 3863, 1638, 1573, 1501, 1343, 1321]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 4876 is out of bounds for axis 1 with size 3880 ERROR:root:Error processing image {'id': 'IMG_20181110_234904.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181110_234904.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [5, 208, 444, 3513, 3606, 3825, 3847, 3907, 3929, 4225, 4296, 4636, 4718, 4877, 5014, 5085, 4932, 4647, 4494, 4252, 3984, 3677, 3677, 3567, 3485, 3820, 3847, 4132, 4340, 4389, 4466, 4428, 4302, 4061, 3907, 3661, 3688, 3683, 4066, 4340, 4466, 4510, 4466, 4346, 2948, 2707, 2548, 2439, 5, 16, 449, 345, 329, 11], 'all_points_y': [378, 66, 5, 11, 148, 274, 329, 329, 241, 142, 181, 110, 164, 27, 258, 499, 1014, 1129, 1014, 1096, 1107, 1025, 1184, 1321, 1529, 1381, 1397, 1348, 1436, 1567, 1808, 2006, 2082, 2197, 2170, 2170, 2395, 2450, 2581, 2756, 3096, 3381, 3639, 3858, 3874, 3754, 3754, 3852, 3863, 1638, 1573, 1501, 1343, 1321]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 4876 is out of bounds for axis 1 with size 3880 2019-10-24 12:44:40.032022: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0 2019-10-24 12:44:41.064467: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 ERROR:root:Error processing image {'id': 'IMG_20181025_192944.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181025_192944.jpg', 'width': 3000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3966, 3729, 3458, 3093, 2653, 2542, 1716, 1254, 1169, 742, 449, 360, 428, 597, 864, 1051, 1208, 1271, 1364, 1669, 2288, 2797, 3394, 3788, 3797, 3996], 'all_points_y': [1797, 2064, 2085, 1953, 1924, 2008, 1860, 1716, 1483, 1530, 1428, 1216, 958, 864, 869, 936, 936, 945, 733, 538, 479, 487, 568, 691, 746, 860]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3000 is out of bounds for axis 1 with size 3000 ERROR:root:Error processing image {'id': 'IMG_20181025_192944.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181025_192944.jpg', 'width': 3000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3966, 3729, 3458, 3093, 2653, 2542, 1716, 1254, 1169, 742, 449, 360, 428, 597, 864, 1051, 1208, 1271, 1364, 1669, 2288, 2797, 3394, 3788, 3797, 3996], 'all_points_y': [1797, 2064, 2085, 1953, 1924, 2008, 1860, 1716, 1483, 1530, 1428, 1216, 958, 864, 869, 936, 936, 945, 733, 538, 479, 487, 568, 691, 746, 860]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3000 is out of bounds for axis 1 with size 3000 4/100 [>.............................] - ETA: 34:06 - loss: 3.3600 - rpn_class_loss: 0.0100 - rpn_bbox_loss: 0.7305 - mrcnn_class_loss: 0.6806 - mrcnn_bbox_loss: 1.3180 - mrcnn_mask_loss: 0.6208ERROR:root:Error processing image {'id': 'IMG_20181026_165816.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181026_165816.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [4318, 4110, 4017, 3529, 3315, 3200, 3036, 3030, 2663, 2597, 2055, 1940, 1534, 1019, 696, 674, 784, 1233, 1315, 1545, 1682, 1770, 1984, 2269, 2439, 3156, 3513, 3841, 4165, 4554, 4773, 5102, 5162, 4696, 4439], 'all_points_y': [3266, 3299, 2937, 2976, 3518, 3677, 3759, 3376, 3047, 2724, 2471, 2696, 3036, 3080, 2778, 2417, 2176, 1973, 1825, 1666, 1266, 1156, 800, 570, 515, 570, 570, 1277, 1880, 2099, 2203, 2323, 2833, 2685, 2521]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3880 is out of bounds for axis 1 with size 3880 ERROR:root:Error processing image {'id': 'IMG_20181026_165816.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181026_165816.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [4318, 4110, 4017, 3529, 3315, 3200, 3036, 3030, 2663, 2597, 2055, 1940, 1534, 1019, 696, 674, 784, 1233, 1315, 1545, 1682, 1770, 1984, 2269, 2439, 3156, 3513, 3841, 4165, 4554, 4773, 5102, 5162, 4696, 4439], 'all_points_y': [3266, 3299, 2937, 2976, 3518, 3677, 3759, 3376, 3047, 2724, 2471, 2696, 3036, 3080, 2778, 2417, 2176, 1973, 1825, 1666, 1266, 1156, 800, 570, 515, 570, 570, 1277, 1880, 2099, 2203, 2323, 2833, 2685, 2521]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3880 is out of bounds for axis 1 with size 3880 ERROR:root:Error processing image {'id': 'IMG_20181106_143013.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181106_143013.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [5157, 4828, 3798, 3184, 2378, 2230, 1523, 1359, 1496, 1797, 2055, 2208, 2252, 2422, 2751, 2893, 2992, 2921, 2904, 3124, 3266, 3365, 3211, 3562, 3748, 3765, 3946, 4461, 4899, 5085, 5179], 'all_points_y': [3365, 3474, 3365, 3589, 3211, 2959, 2861, 2570, 2280, 2115, 2148, 2230, 1885, 1770, 1595, 1611, 1282, 882, 800, 712, 860, 1107, 1775, 1786, 1715, 1715, 1447, 1003, 773, 718, 926]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 5082 is out of bounds for axis 1 with size 3880 ERROR:root:Error processing image {'id': 'IMG_20181106_143013.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181106_143013.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [5157, 4828, 3798, 3184, 2378, 2230, 1523, 1359, 1496, 1797, 2055, 2208, 2252, 2422, 2751, 2893, 2992, 2921, 2904, 3124, 3266, 3365, 3211, 3562, 3748, 3765, 3946, 4461, 4899, 5085, 5179], 'all_points_y': [3365, 3474, 3365, 3589, 3211, 2959, 2861, 2570, 2280, 2115, 2148, 2230, 1885, 1770, 1595, 1611, 1282, 882, 800, 712, 860, 1107, 1775, 1786, 1715, 1715, 1447, 1003, 773, 718, 926]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 5082 is out of bounds for axis 1 with size 3880 ERROR:root:Error processing image {'id': 'IMG_20181026_140009.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181026_140009.jpg', 'width': 3000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3992, 3123, 3034, 2432, 2250, 1737, 1542, 1301, 1089, 987, 1025, 1254, 1470, 1555, 1623, 2144, 2525, 2860, 2941, 3521, 3801, 3992, 3966], 'all_points_y': [2682, 2695, 2860, 2911, 2970, 2924, 2610, 2678, 2720, 2568, 2326, 2263, 2326, 2309, 2140, 1996, 1975, 1949, 2097, 2148, 2182, 2102, 2411]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3000 is out of bounds for axis 1 with size 3000 ERROR:root:Error processing image {'id': 'IMG_20181026_140009.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181026_140009.jpg', 'width': 3000, 'height': 4000, 'polygons': [{'name': 'polygon', 'all_points_x': [3992, 3123, 3034, 2432, 2250, 1737, 1542, 1301, 1089, 987, 1025, 1254, 1470, 1555, 1623, 2144, 2525, 2860, 2941, 3521, 3801, 3992, 3966], 'all_points_y': [2682, 2695, 2860, 2911, 2970, 2924, 2610, 2678, 2720, 2568, 2326, 2263, 2326, 2309, 2140, 1996, 1975, 1949, 2097, 2148, 2182, 2102, 2411]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3000 is out of bounds for axis 1 with size 3000 8/100 [=>............................] - ETA: 24:35 - loss: 2.7762 - rpn_class_loss: 0.0144 - rpn_bbox_loss: 0.7168 - mrcnn_class_loss: 0.3957 - mrcnn_bbox_loss: 1.0654 - mrcnn_mask_loss: 0.5839ERROR:root:Error processing image {'id': 'IMG_20181106_113715.jpg', 'source': 'human', 'path': '/content/Mask_RCNN/samples/bottle/dataset/train/IMG_20181106_113715.jpg', 'width': 3880, 'height': 5184, 'polygons': [{'name': 'polygon', 'all_points_x': [16, 1677, 1786, 1819, 1940, 2197, 2400, 2713, 2866, 3200, 3419, 3600, 3496, 3239, 2828, 2630, 2713, 2850, 3030, 3315, 3606, 3929, 4083, 4033, 0], 'all_points_y': [27, 16, 225, 543, 652, 619, 532, 521, 575, 652, 860, 1228, 1573, 1858, 1995, 1896, 2143, 2313, 2269, 2230, 2186, 2307, 2636, 2904, 2904]}]} Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3880 is out of bounds for axis 1 with size 3880 multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 641, in next_sample return six.next(_SHARED_SEQUENCES[uid]) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator use_mini_mask=config.USE_MINI_MASK) File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1212, in load_image_gt mask, class_ids = dataset.load_mask(image_id) File "bottle/bottle.py", line 164, in load_mask mask[rr, cc, i] = 1 IndexError: index 3880 is out of bounds for axis 1 with size 3880 """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "bottle/bottle.py", line 363, in train(model) File "bottle/bottle.py", line 199, in train layers='heads') File "/usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 2374, in train File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1658, in fit_generator initial_epoch=initial_epoch) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py", line 181, in fit_generator generator_output = next(output_generator) File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 733, in get six.reraise(*sys.exc_info()) File "/usr/local/lib/python3.6/dist-packages/six.py", line 693, in reraise raise value File "/usr/local/lib/python3.6/dist-packages/keras/utils/data_utils.py", line 702, in get inputs = future.get(timeout=30) File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value IndexError: index 3880 is out of bounds for axis 1 with size 3880

sree369nidhi avatar Oct 24 '19 13:10 sree369nidhi

This seems like not a MaskRCNN error, however. There are some issues when you try to load the masks for your custom dataset.

File "bottle/bottle.py", line 164, in load_mask
mask[rr, cc, i] = 1
IndexError: index 3880 is out of bounds for axis 1 with size 3880

In this piece of code, check the value (range) of the variable i. Have you written your own custom Configuration Class and also the Custom Dataset class?

sainatarajan avatar Oct 25 '19 10:10 sainatarajan

I am using the ballon configuration provided in the samples since I am also training just one class and one background same as the ballon color splash custom dataset. I don't know why I am facing an index out of range error. Even though images are of different size they should be resized automatically right before they are trained. Any help regarding this error

sree369nidhi avatar Oct 28 '19 13:10 sree369nidhi

Okay. So mostly this error is related to indexing values. You can address the array (mask[]) with axis 1 having the range (0, 3880) (3880 not inclusive). So when it tries to execute mask[rr, 3880, i]= 1, it throws the error since the array can be addressed upto only from 0 to 3879 and not 0 to 3880. If this fails, try to print rr and cc and find out the values before the error throws up.

sainatarajan avatar Oct 28 '19 13:10 sainatarajan

what I came to know is that I am using 20 MP images with a resolution like 4000x4000 or above and it is causing the problem. In sample examples, custom bottle dataset the highest resolution of images was 2000x2000 so it didn't give any index errors. After resizing my pictures and then tried training my dataset it worked. But is there any possibility to apply on bigger resolution images

sree369nidhi avatar Oct 28 '19 13:10 sree369nidhi

@sree369nidhi appreciate your use case may require larger images -- faced similar overflow issues. smaller images, when possible, accelerate training. have you tried either:

  1. using smaller resolution, but doing more augmentation to improve the training set
  2. using a two-stage model - detect your object of interest is in frame, and then classify? my email is public on GH - can email more

josephofiowa avatar Nov 08 '19 19:11 josephofiowa

Yes, I tried using smaller resolution images and it worked perfectly fine. I tried to make all my images under 2k resolution and it worked fine for me. I don't know about the second method please share some info or article so that I can go through

sree369nidhi avatar Nov 08 '19 19:11 sree369nidhi

@sree369nidhi sure. your RCNN implementation is an example two-staged approach of only examining regions of interest vs single shot detection / YOLO which treat detection like a regression problem to identify bounding boxes - faster but perhaps less accurate (here's a good overview).

did you see fast, accurate performance with your downsized images? if too slow, consider an architecture that determines if a specific image is challenging, then feeds the image to either a single shot detector or RCNN (eg). otherwise, consider more augmentations to your images.

my interest here: i'm focused on improving models with fewer examples via augmentation, and i'm curious in your problem as an example to discuss more.

josephofiowa avatar Nov 08 '19 19:11 josephofiowa

I think downsizing the images before feeding it to Mask RCNN gave me faster results and accuracy is the same as when I tried to perform some inferences on demo.inypb, my application is to use Mask RCNN to emulate Portrait Mode effect on the background of the image leaving the person in the image as it is.

I don't know how to use YOLO in this case as it only produces bounding boxes whereas Mask RCNN gives me a mask of a particular object in this case human

sree369nidhi avatar Nov 08 '19 20:11 sree369nidhi

Ah, gotcha. Masks needed 👍

Would love to see results of the project!

josephofiowa avatar Nov 08 '19 20:11 josephofiowa

yup need masks... with some references from Mask RCNN Shinny, I have tried and it worked out pretty fine check the demo folder for results link : https://github.com/sree369nidhi/Image_Segmentation_Mini_Project and Thanks for helping out.

sree369nidhi avatar Nov 08 '19 21:11 sree369nidhi

Nice - the outputs turned out really well. For what it's worth, even in Apple's implementation of portrait mode, they don't appear to use the full image height and width. From what's exposed via the API, they take half the height and width, create the segment map, and scale it back to the full size of the image.

Can I email you to talk more about how you collected, labeled, and trained images for this project?

josephofiowa avatar Nov 08 '19 21:11 josephofiowa

I used via image annotations and fine tuned on Coco pretrained weights, just used few images because Mask RCNN already comes with pretrained Coco dataset images and it already works very well. Actually for demo I used pretrained weights of Mask RCNN itself and results are pretty fine.

sree369nidhi avatar Nov 14 '19 07:11 sree369nidhi

Hi @sree369nidhi, I am also having this error and I tried including this condition to resize the images in the load_balloon function in class BalloonDataset(utils.Dataset):

`# load_mask() needs the image size to convert polygons to masks. # Unfortunately, VIA doesn't include it in JSON, so we must read # the image. This is only managable since the dataset is tiny. image_path = os.path.join(dataset_dir, a['filename']) image = skimage.io.imread(image_path) height, width = image.shape[:2]

        # Resize image if image height and/or width greater than 2000
        if height > 2000 or width > 2000:
            image = skimage.transform.resize(image, (2000, 2000), preserve_range=False)
            height, width = image.shape[:2]`

But the error does not leave. Please how were you able to solve yours? Thank you for your help.

Mofetoluwa avatar Jul 01 '20 18:07 Mofetoluwa

@Mofetoluwa This error occurs because you're trying to access an item that is beyond the NumPy array. Try to adapt my following code, to your project and check if it's working.

Note: This only works for the dataset that was annotated using the VIA tool.

# Import necessary libraries

# This file can be downloaded at https://github.com/sainatarajan/U-Net/blob/master/delaunay2D.py
from delaunay2D import Delaunay2D

def calculateDelauneyPoints(points):
    points= np.array(points).astype(int)
    points= [list(item) for item in points]
    dt = Delaunay2D()
    for s in points:
        dt.addPoint(s)
    coord, tris= dt.exportDT()
    return np.array(coord)

class SceneDataset(utils.Dataset):

    def load_scene(self, dataset_dir, subset):
        """Load a subset of the scene dataset.
        dataset_dir: Root directory of the dataset.
        subset: Subset to load: train or val
        """
        # Add classes. We have only one class to add.
        self.add_class("scene", 1, "car")
        self.add_class("scene", 2, "person")

        # Train or validation dataset?
        assert subset in ["train", "val"]
        dataset_dir = os.path.join(dataset_dir, subset)

        # Load annotations
        
        # We mostly care about the x and y coordinates of each region
        annotations1 = json.load(open(os.path.join(dataset_dir, "via_region_data.json")))
        
        annotations = list(annotations1.values())  # don't need the dict keys

        # The VIA tool saves images in the JSON even if they don't have any
        # annotations. Skip unannotated images.
        annotations = [a for a in annotations if a['regions']]
        
        # Add images
        for a in annotations:
            # Get the x, y coordinaets of points of the polygons that make up
            # the outline of each object instance. There are stores in the
            # shape_attributes (see json format above)
            
            polygons = [r['shape_attributes'] for r in a['regions']]

            try:
                objects= [r['region_attributes']['Object'] for r in a['regions']]
            except:
                continue
            
            # load_mask() needs the image size to convert polygons to masks.
            # Unfortunately, VIA doesn't include it in JSON, so we must read
            # the image. This is only managable since the dataset is tiny.
            
            for i in range(len(polygons)):
                if objects[i] in ['car']:
                    polygons[i]['name']= 'car'
                elif objects[i] in ['person']:
                    polygons[i]['name']= 'person'
                else:
                    polygons[i]['name']= 'Others'

            image_path = os.path.join(dataset_dir, a['filename'])
            image = skimage.io.imread(image_path)
            height, width = image.shape[:2]
            labels= 1

            if 'person' in objects:
                labels+= 1
            
            self.add_image( "scene", image_id=a['filename'], path=image_path, width=width, height=height, polygons=polygons, labels= labels)
            
    def load_image(self, image_id):
        """Generate an image from the specs of the given image ID.
        Typically this function loads the image from a file, but
        in this case it generates the image on the fly from the
        specs in image_info.
        """
        info= self.image_info[image_id]
        path= info['path']
        return cv2.imread(path)

    def load_mask(self, image_id):
        """Generate instance masks for an image.
        Returns:
        masks: A bool array of shape [height, width, instance count] with
            one mask per instance.
        class_ids: a 1D array of class IDs of the instance masks.
        """
        
        # If not a scene dataset image, delegate to parent class.
        info = self.image_info[image_id]
        labels= info['labels']
        polygon= info['polygons']
        label_names= [i['name'] for i in polygon]

        mask_names= ['car', 'person', 'Others']
        dims= len(label_names)
        mask= np.zeros([info['height'], info['width'], dims], dtype= np.uint8)
        for i in range(dims):
            poly= polygon[i]
            label_name= label_names[i]
            mask[:, :, i:i+1]= self.draw_mask(mask[:, :, i:i+1].copy(), poly, label_name)
        class_ids= np.array([(mask_names.index(i) + 1) for i in label_names])
        return mask.astype(np.bool), class_ids.astype(np.int32)

    def draw_mask(self, image, poly, label_name):
        all_x= poly['all_points_x']
        all_y= poly['all_points_y']
        points= [(all_x[i], all_y[i]) for i in range(len(all_x))]

        if label_name in ['car', 'person']:
            rect= calculateDelauneyPoints(points)
            image= cv2.drawContours(image, [rect], -1, (255, 255, 255), cv2.FILLED)

        return image
    
    def image_reference(self, image_id):
        """Return the path of the image."""
        info = self.image_info[image_id]
        if info["source"] == "scene":
            return info["path"]
        else:
            super(self.__class__, self).image_reference(image_id)

sainatarajan avatar Jul 01 '20 18:07 sainatarajan

@sainatarajan alright thank you, I will try it out. What does the calculateDelauneyPoints function do?

Mofetoluwa avatar Jul 01 '20 19:07 Mofetoluwa

@Mofetoluwa calculateDelauneyPoints() performs the Delaunay triangulation operation on the set of given points. This is done so that the cv2.drawContours() doesn't produce an error while drawing the mask. It might not be required for your case. In my case, the annotated points weren't triangulated and therefore the cv2.drawContours() produced an error.

sainatarajan avatar Jul 01 '20 19:07 sainatarajan

Oh alright then. Thank you

Mofetoluwa avatar Jul 01 '20 19:07 Mofetoluwa

@Mofetoluwa If we are training custom dataset, does mask rcnn by default shuffle the images before training ?

hamzanaeem1999 avatar May 12 '22 13:05 hamzanaeem1999