when I run train_faster_rcnn_alt_opt.py,error occurs:
I1210 14:39:47.685863 223288 layer_factory.hpp:76] Creating layer input-data
I1210 14:39:47.786041 223288 net.cpp:112] Creating Layer input-data
I1210 14:39:47.786516 223288 net.cpp:435] input-data -> data
I1210 14:39:47.787017 223288 net.cpp:435] input-data -> im_info
I1210 14:39:47.788019 223288 net.cpp:435] input-data -> gt_boxes
I1210 14:39:47.804545 223288 python_layer.hpp:43] Traceback (most recent call last):
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\roi_data_layer\layer.py", line 125, in setup
top[idx].reshape(1, self._num_classes * 4)
IndexError: Index out of range
Process Process-1:
Traceback (most recent call last):
File "D:\Anaconda\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "D:\Anaconda\lib\multiprocessing\process.py", line 114, in run
self._target(_self._args, *_self._kwargs)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\toolstrain_faster_rcnn_alt_opt.py", line 130, in train_rpn
max_iters=max_iters)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\fast_rcnntrain.py", line 134, in train_net
pretrained_model=pretrained_model)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\fast_rcnntrain.py", line 43, in __init__
self.solver = caffe.SGDSolver(solver_prototxt)
File "F:\sunqin\DeepLearning\Caffe\Projects\faster-rcnn\tools..\lib\roi_data_layer\layer.py", line 125, in setup
top[idx].reshape(1, self._num_classes * 4)
IndexError: Index out of range
Anyone knows how to fix it?
I met the same problem, is this problem solved? thanks.
I tried training the VOC dataset without weights using end2end algorithm. I am also facing the same issue. The value of idx is 3 and it seems like top[3] doesn't exist .
Do you provide a config file (eg. experiments/cfgs/faster_rcnn_end2end.yml)? Looks like cfg.TRAIN.HAS_RPN is false but it should be true! Please have a look at experiments/scripts/faster_rcnn_end2end.sh for details.
The config file is present and has TRAIN.HAS_RPN = True. Also the experiments/scripts/faster_rcnn_end2end.sh is correctly pointing to that file. I am getting this issue while training with ZF network. The VGG16 network trains without any issue.
Do you get the error in the same line as wait1988? If you look at the code of lib\roi_data_layer\layer.py you will see that line 125 clearly belongs to the else branch of if cfg.TRAIN.HAS_RPN, so I still suppose the config isn't right. Maybe some debugging could help?
any one fix this problem ?
i got the same error when i train on custom data with vgg16 ...
@Johannes-brahms Did you ever find a fix? Like you, I need to train on custom data with VGG16 and am getting this error..
I use end2end training and it works for ZF and VGG16 model
I'm similarly using end2end and VGG16 and getting the error you originally posted.
I tried training the VOC dataset using end2end algorithm and face the same issue.
I tried to give the train_net this file as a parameter: --cfg /home/limor/FRCN_ROOT/py-faster-rcnn/experiments/cfgs/faster_rcnn_end2end.yml but the file is loaded to cfg_from_file variable and the algorithm ignore it since it read from cfg variable and not from cfg_from_file (see file /home/limor/FRCN_ROOT/py-faster-rcnn/lib/fast_rcnn/train.py)
It work if I hardcoded change the /home/limor/FRCN_ROOT/py-faster-rcnn/lib/fast_rcnn/config.py following the yml file. but changing harcoded should not be the solution...
what should need to do ?
@chrert Thank you. Your solution worked!
delete this file py-faster-rcnn/data/cache/ voc_2007_trainval_gt_roidb.pkl
Do you provide a config file (eg.
experiments/cfgs/faster_rcnn_end2end.yml)? Looks like cfg.TRAIN.HAS_RPN is false but it should be true! Please have a look atexperiments/scripts/faster_rcnn_end2end.shfor details.
Nice solution!Thanks!
Most helpful comment
Do you provide a config file (eg.
experiments/cfgs/faster_rcnn_end2end.yml)? Looks like cfg.TRAIN.HAS_RPN is false but it should be true! Please have a look atexperiments/scripts/faster_rcnn_end2end.shfor details.