nqanh / affordance-net

AffordanceNet - Multiclass Instance Segmentation Framework - ICRA 2018
Other
121 stars 54 forks source link

Error: Number of labels must match number of predictions #9

Closed MartinPlantinga closed 6 years ago

MartinPlantinga commented 6 years ago

When trying to train with the IIT-AAF dataset I get an error with regards to the Number of labels:

I1211 15:56:06.012106  4756 net.cpp:106] Creating Layer mask_deconv3
I1211 15:56:06.012109  4756 net.cpp:454] mask_deconv3 <- pool5_2_conv6_relu
I1211 15:56:06.012112  4756 net.cpp:411] mask_deconv3 -> mask_deconv3
I1211 15:56:06.012537  4756 net.cpp:150] Setting up mask_deconv3
I1211 15:56:06.012545  4756 net.cpp:157] Top shape: 1 256 244 244 (15241216)
I1211 15:56:06.012548  4756 net.cpp:165] Memory required for data: 1637661548
I1211 15:56:06.012552  4756 layer_factory.hpp:77] Creating layer mask_score
I1211 15:56:06.012559  4756 net.cpp:106] Creating Layer mask_score
I1211 15:56:06.012562  4756 net.cpp:454] mask_score <- mask_deconv3
I1211 15:56:06.012567  4756 net.cpp:411] mask_score -> mask_score
I1211 15:56:06.012789  4756 net.cpp:150] Setting up mask_score
I1211 15:56:06.012795  4756 net.cpp:157] Top shape: 1 10 244 244 (595360)
I1211 15:56:06.012797  4756 net.cpp:165] Memory required for data: 1640042988
I1211 15:56:06.012801  4756 layer_factory.hpp:77] Creating layer loss_mask
I1211 15:56:06.012809  4756 net.cpp:106] Creating Layer loss_mask
I1211 15:56:06.012811  4756 net.cpp:454] loss_mask <- mask_score
I1211 15:56:06.012814  4756 net.cpp:454] loss_mask <- mask_targets
I1211 15:56:06.012817  4756 net.cpp:411] loss_mask -> loss_mask
I1211 15:56:06.012823  4756 layer_factory.hpp:77] Creating layer loss_mask
F1211 15:56:06.014055  4756 softmax_loss_layer.cpp:47] Check failed: outer_num_ * inner_num_ == bottom[1]->count() (59536 vs. 0) Number of labels must match number of predictions; e.g., if softmax axis == 1 and prediction shape is (N, C, H, W), label count (number of labels) must be N*H*W, with integer values in {0, 1, ..., C-1}.
*** Check failure stack trace: ***
./experiments/scripts/faster_rcnn_end2end.sh: line 65:  4756 Aborted                 ./tools/train_net.py --gpu ${GPU_ID} --solver models/${PT_DIR}/${NET}/faster_rcnn_end2end/solver.prototxt --weights data/imagenet_models/${NET}.v2.caffemodel --imdb ${TRAIN_IMDB} --iters ${ITERS} --cfg experiments/cfgs/faster_rcnn_end2end.yml ${EXTRA_ARGS}

Any idea how to solve this?

Thanks

nqanh commented 6 years ago

Hi, did you change anything in the prototxt file and/or the code (e.g., number of affordance class)? The top shape is correct for 10 affordance classes Top shape: 1 10 244 244 (595360), but the bottom shape is 0, which is not correct.

MartinPlantinga commented 6 years ago

Yes, I did change the $Affordance-Net/lib/rpn/proposal_target_layer.py for a script from py-faster-rcnn. This caused the error. The reason I did this is because when using your $Affordance-Net/lib/rpn/proposal_target_layer.py I got type-error messages. These are probably caused by using a different version of Numpy (v 13.3). I have been able to partially solve these errors, but not all of them.

Therefore I am going to close this Issue and start a new one.