Closed June-Jo closed 7 years ago
Hello, I solved the above problem. In the june.py, there is a _load_june_annotation function. In that function,
cls = float(tokens[0]) + 1
should be changed to
cls = float(tokens[0])
because my dataset is started from 1(bottle) and 0 is the background. I don't need to plus 1 to cls.
But now I have another problem.
When I command
./experiments/scripts/faster_rcnn_end2end_june.sh 1 VGG16
I get the error below.
Traceback (most recent call last):
File "./tools/train_net.py", line 104, in <module>
imdb, roidb = combined_roidb(args.imdb_name)
File "./tools/train_net.py", line 69, in combined_roidb
roidbs = [get_roidb(s) for s in imdb_names.split('+')]
File "./tools/train_net.py", line 66, in get_roidb
roidb = get_training_roidb(imdb)
File "/home/irobot/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 122, in get_training_roidb
rdl_roidb.prepare_roidb(imdb)
File "/home/irobot/py-faster-rcnn/tools/../lib/roi_data_layer/roidb.py", line 27, in prepare_roidb
roidb[i]['image'] = imdb.image_path_at(i)
IndexError: list index out of range
Even though I delete the folder py-faster-rcnn/data/cache, the error doesn't disappear. Is there any solution?
I resolved this problem by turning off the flipping function. But now I have another problem about the floating point exception.
./experiments/scripts/faster_rcnn_end2end_june.sh: line 40: 11438 Floating point exception(core dumped) ./tools/train_net.py --gpu ${GPU_ID} --solver models/${NET}/faster_rcnn_end2end/solver.prototxt --weights ${NET_INIT} --imdb ${DATASET_TRAIN} --iters ${ITERS} --cfg experiments/cfgs/faster_rcnn_end2end.yml ${EXTRA_ARGS}
I tried to lower the learning rate, change RND_SEED, and filter_roidb but nothing can solve this problem.
I printed out the dw and dh, but there is not a problem. the values were about -1~4. I can not figure out what cause this problem in my case. Is there any idea?
@HyunJun-Jo Flipping function should not be turned off. Instead figure out if your images are 0-indexed or 1-indexed and based on that you need to make some changes in june.py and june_eval.py.
@plopd Thanks for your advice.
Okay, I will turn on the flipping function. Then, do I need some flipped images?
My dataset have 6 classes(bottle(1), cell phone(2), gear(3), ... , piston(6)) and 1 more class(background(0), so I think cls = float(tokens[0]) is right? How do you think about it?
Is there any idea about the floating point exception error?
When I turn on the flipping function, the index problem has come up. My training set has 880 images now, but the maximum of the indices is 1760 which is double of 880. How can I use the flipping function?
Turning off the flipping function, the floating point exception error still come up. But I found that there is a problem of loss values.
I0113 15:01:54.791416 4315 solver.cpp:229] Iteration 0, loss = 3.01861
I0113 15:01:54.791440 4315 solver.cpp:245] Train net output #0: loss_bbox = 0 (* 1 = 0 loss)
I0113 15:01:54.791443 4315 solver.cpp:245] Train net output #1: loss_cls = 1.12346 (* 1 = 1.12346 loss)
I0113 15:01:54.791462 4315 solver.cpp:245] Train net output #2: rpn_cls_loss = 0.795926 (* 1 = 0.795926 loss)
I0113 15:01:54.791467 4315 solver.cpp:245] Train net output #3: rpn_loss_bbox = 0 (* 1 = 0 loss)
I0113 15:01:54.791484 4315 sgd_solver.cpp:106] Iteration 0, lr = 0.0001
I0113 15:02:01.060256 4315 solver.cpp:229] Iteration 20, loss = 0.00354396
I0113 15:02:01.060279 4315 solver.cpp:245] Train net output #0: loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:01.060286 4315 solver.cpp:245] Train net output #1: loss_cls = 0 (* 1 = 0 loss)
I0113 15:02:01.060292 4315 solver.cpp:245] Train net output #2: rpn_cls_loss = 0.00359094 (* 1 = 0.00359094 loss)
I0113 15:02:01.060297 4315 solver.cpp:245] Train net output #3: rpn_loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:01.060317 4315 sgd_solver.cpp:106] Iteration 20, lr = 0.0001
I0113 15:02:07.125023 4315 solver.cpp:229] Iteration 40, loss = 6.55651e-07
I0113 15:02:07.125046 4315 solver.cpp:245] Train net output #0: loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:07.125051 4315 solver.cpp:245] Train net output #1: loss_cls = 0 (* 1 = 0 loss)
I0113 15:02:07.125071 4315 solver.cpp:245] Train net output #2: rpn_cls_loss = 1.19209e-07 (* 1 = 1.19209e-07 loss)
I0113 15:02:07.125074 4315 solver.cpp:245] Train net output #3: rpn_loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:07.125092 4315 sgd_solver.cpp:106] Iteration 40, lr = 0.0001
I0113 15:02:13.131383 4315 solver.cpp:229] Iteration 60, loss = 0.010118
I0113 15:02:13.131407 4315 solver.cpp:245] Train net output #0: loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:13.131412 4315 solver.cpp:245] Train net output #1: loss_cls = 0 (* 1 = 0 loss)
I0113 15:02:13.131429 4315 solver.cpp:245] Train net output #2: rpn_cls_loss = 0.0202161 (* 1 = 0.0202161 loss)
I0113 15:02:13.131433 4315 solver.cpp:245] Train net output #3: rpn_loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:13.131438 4315 sgd_solver.cpp:106] Iteration 60, lr = 0.0001
I0113 15:02:19.142662 4315 solver.cpp:229] Iteration 80, loss = 7.51021e-06
I0113 15:02:19.142685 4315 solver.cpp:245] Train net output #0: loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:19.142689 4315 solver.cpp:245] Train net output #1: loss_cls = 0 (* 1 = 0 loss)
I0113 15:02:19.142709 4315 solver.cpp:245] Train net output #2: rpn_cls_loss = 8.10626e-06 (* 1 = 8.10626e-06 loss)
I0113 15:02:19.142712 4315 solver.cpp:245] Train net output #3: rpn_loss_bbox = 0 (* 1 = 0 loss)
I0113 15:02:19.142716 4315 sgd_solver.cpp:106] Iteration 80, lr = 0.0001
./experiments/scripts/faster_rcnn_end2end_june.sh: line 40: 4315 Floating point exception(core dumped) ./tools/train_net.py --gpu ${GPU_ID} --solver models/${NET}/faster_rcnn_end2end/solver.prototxt --weights ${NET_INIT} --imdb ${DATASET_TRAIN} --iters ${ITERS} --cfg experiments/cfgs/faster_rcnn_end2end.yml ${EXTRA_ARGS}
irobot@irobot:~/py-faster-rcnn$
The loss values are very low and even zero!!! I think the floating point exception error comes up because of the very low loss values. Is there any way or idea to solve this problem? Somebody gave me an advice that I have too small dataset(training:268, test:31) so I made a bigger dataset(training:880, test:120) but this problem is not solved yet.
I think that maybe the bounding box is not properly generated. What should I modify? I checked the june.py and june_eval.py, but I couldn't find some error there.
Because I'm very new in this field and even in the computer vision, I'm very confused now.... Help me, brothers!
I don't know why the floating exception error comes up, but I have expanded my dataset, and now I don't get it.
@HyunJun-Jo Hi~ have you solvered the problem?
Hi When i give for fast rcnn training i get the following error
File "/home/alpha/fast-rcnn/py-faster-rcnn/tools/../lib/datasets/fishclassify.py", line 118, in rpn_roidb if int(self._year) == 2007 or self._image_set != 'test': AttributeError: 'fishclassify' object has no attribute '_year'
I checked the basketball.py in the basketball project. There also _year is not declared in def init. Pls advice me how to overcome this error.
@HyunJun-Jo Hello , Have you solved the problem?
HI Guys, While training the network on my own data.
I got this error..
What is the solution for this??
I0607 11:45:46.728519 2386 net.cpp:283] Network initialization done. I0607 11:45:46.728889 2386 solver.cpp:60] Solver scaffolding done. Loading pretrained model weights from ./data/faster_rcnn_models/ZF_faster_rcnn_final.caffemodel I0607 11:45:48.512673 2386 net.cpp:816] Ignoring source layer data F0607 11:45:48.516479 2386 net.cpp:829] Cannot copy param 0 weights from layer 'conv3'; shape mismatch. Source param shape is 384 256 3 3 (884736); target param shape is 512 256 3 3 (1179648). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer. Check failure stack trace: Aborted (core dumped)
I have 2 classes. I have images of size 512 * 512..
Please help someone who knows this..
I'm trying to train the faster-rcnn using my own dataset.
Now when I command
I got error below.
I changed a lot of things to train faster-rcnn, so let me show you how I made the dataset and what I changed.
Datasets
/py-faster-rcnn/data/JUNE_devkit
JUNE_devkit has 3 folders like below.
Annotations folder has the text files such as 00000014.txt. The contents of these files are like '1 330 160 540 520' where 1 is class, 330 & 160 is the left top of the ROI, and 540 & 520 is right bottom of the ROI.
Images folder has the pictures named as 00000014.bmp. The size of the pictures are same of 1280x1024.
ImageSets folder has 2 text files, train.txt and test.txt. The contents of these are the image names without extensions of traing set and test set, for example, 0000014.
Changed codes
/py-faster-rcnn/experiments/scripts
In this folder, I made a file 'faster_rcnn_end2end_june.sh' refering the 'faster_rcnn_end2end.sh' and 'faster_rcnn_end2end_imagenet.sh'.
faster_rcnn_end2end_june.sh
/py-faster-rcnn/lib/datasets
At the factory.py, I added codes below.
factory.py
june.py is copied from pascal_voc.py and changed a little bit.
june.py
/py-faster-rcnn/model/VGG16/faster_rcnn_end2end
I copied VGG16 from pascal_voc. Here, test.prototxt and train.prototxt files have been changed. I'm using 7 classes(6 classes + 1 background class), so the num_classes would be 7 and the num_ouput would be 28 in the both prototxt files.
These tasks are done referring here. I also tried to remove the cache folder and the output folder, it doesn't work. I need your help, please. I'm sorry to write a very long post, but I wish this problem be solved A.S.A.P..