I tried training the VOC dataset using end2end algorithm and face the following error:
File "/home/limor/FRCN_ROOT/py-faster-rcnn/tools/train_net.py", line 113, in
max_iters=args.max_iters)
File "/home/limor/FRCN_ROOT/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 157, in train_net
pretrained_model=pretrained_model)
File "/home/limor/FRCN_ROOT/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 43, in init
self.solver = caffe.SGDSolver(solver_prototxt)
File "/home/limor/FRCN_ROOT/py-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
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 ?
There's a bug in the usage of EasyDict in the cfg_from_file function.
If you look at lib/fast_rcnn/config.py, then after the line:
b[k] = v
add the following line:
setattr(b, k, v)
You can't set new values through the dictionary interface of EasyDict, you also need to update the property interface.
As mentioned by @koenvandesande , this should be a bug in the usage of EasyDict. I encountered similar error before and my solution was to install verydeep/easydict. Normally, people might install EasyDict according to Easydict::Anaconda. However, this version is 1.4. We can install EasyDict-1.6 by conda install -c verydeep easydict. Hope this can solve the problem~
I get the same error, have you solved it?
@Huangying-Zhan Perfect!!!
Most helpful comment
As mentioned by @koenvandesande , this should be a bug in the usage of EasyDict. I encountered similar error before and my solution was to install verydeep/easydict. Normally, people might install EasyDict according to Easydict::Anaconda. However, this version is 1.4. We can install EasyDict-1.6 by
conda install -c verydeep easydict. Hope this can solve the problem~