-
Notifications
You must be signed in to change notification settings - Fork 2.5k
IndexError: list index out of range #725
Comments
do you solve this problem? I get this problem too.if you solve it, please tell me .Thank you very much. |
i use pytorch-1.2, it meets this problem. |
Did any of you manage to solve the problem? I'm getting exactly the same error as gravitymxb. Are you using your own dataset? |
I got same error too. Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): Traceback (most recent call last): |
See #1053 |
Update: I replaced the one occurrence of torch.uint8 with torch.bool in the segmentation_mask.py file and my code is now running! I read what little was posted under #1053 and the fix is not quite clear. I think I need the fix spelled out more clearly for me. I am trying to get the model to load and run tools/test_net.py on a Linux virtual machine. I can not seem to find a useable PyTorch version 1.1.0 for lynux for Conda=10.0 (if you have a link to one I would love to try it). The earlier version of pytorch for windows (1.1.0) is working on my desktop. I have been working on this for a couple of weeks now trying to get the VM all set up. This is the closest I have been. I appreciate any help offered. -Thanks, Sarah |
This problem has been bothering me for a week. The key problem is that the pytorch's version is too high.Before I used version pytorch 1.2 ,it always had this error. When I changed the pytorch version to 1.1,and used this code 'python setup.py build develop' to recompile. Now my code running successfully ! |
hello @zimenglan-sysu-512 |
suggest that u should replace all of them |
At the very least you should change the segmentation_mask.py file. |
Thanks to @zimenglan-sysu-512 , I've replaced torch.unit8 with torch.bool,and it worked. |
@zimenglan-sysu-512 @zsc1220 @liyz15 |
Are u sure? The required pytorch vision for maskrcnn_bench is 1.0 or it will never be installed successfully. My torch is 1.0 and encouter the same errror. |
I too replaced torch.unit8 with torch.bool in segmentation_mask.py and it worked :) thanks guys for helping me in rotated mask_rcnn but i am getting warning - |
I too replaced torch.unit8 with torch.bool in segmentation_mask.py and it worked ^_^ |
❓ Questions and Help
Hello, I have a problem. I encountered an error while training the data set. Please ask how to solve this problem. Thank you in advance.
Traceback (most recent call last):
File "tools/train_net.py", line 186, in
main()
File "tools/train_net.py", line 179, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 85, in train
arguments,
File "/home/sineva/github/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py", line 57, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "/home/sineva/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/home/sineva/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/sineva/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sineva/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sineva/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 85, in getitem
return self.datasets[dataset_idx][sample_idx]
File "/home/sineva/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.py", line 83, in getitem
masks = SegmentationMask(masks, img.size, mode='poly')
File "/home/sineva/github/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 467, in init
self.instances = PolygonList(instances, size)
File "/home/sineva/github/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 344, in init
assert isinstance(polygons[0][0], (list, tuple)), str(
IndexError: list index out of range
Configuration file:
MODEL:
META_ARCHITECTURE: "GeneralizedRCNN"
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50"
BACKBONE:
CONV_BODY: "R-50-FPN"
RESNETS:
BACKBONE_OUT_CHANNELS: 256
RPN:
USE_FPN: True
ANCHOR_STRIDE: (4, 8, 16, 32, 64)
PRE_NMS_TOP_N_TRAIN: 2000
PRE_NMS_TOP_N_TEST: 1000
POST_NMS_TOP_N_TEST: 1000
FPN_POST_NMS_TOP_N_TEST: 1000
ROI_HEADS:
USE_FPN: True
ROI_BOX_HEAD:
POOLER_RESOLUTION: 7
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
POOLER_SAMPLING_RATIO: 2
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor"
PREDICTOR: "FPNPredictor"
ROI_MASK_HEAD:
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125)
FEATURE_EXTRACTOR: "MaskRCNNFPNFeatureExtractor"
PREDICTOR: "MaskRCNNC4Predictor"
POOLER_RESOLUTION: 14
POOLER_SAMPLING_RATIO: 2
RESOLUTION: 28
SHARE_BOX_FEATURE_EXTRACTOR: False
MASK_ON: False
DATASETS:
TRAIN: ("coco_2014_train", "coco_2014_val")
TEST: ("coco_2014_test",)
DATALOADER:
SIZE_DIVISIBILITY: 32
SOLVER:
BASE_LR: 0.0025
WEIGHT_DECAY: 0.0001
STEPS: (60000, 80000)
MAX_ITER: 90000
Json file:
{
"area": 1320,
"iscrowd": 0,
"image_id": 1211098,
"bbox": [
1160,
21,
33,
40
],
"category_id": 12,
"id": 19781,
"ignore": 0,
"segmentation": []
}
The text was updated successfully, but these errors were encountered: