Longqi-S / Focal-Loss

The implementation of Focal-Loss Using Caffe
37 stars 19 forks source link

error #5

Closed foralliance closed 6 years ago

foralliance commented 6 years ago

@Longqi-S HI

尝试将您的损失层嫁接在py-R-FCN上,编译没有问题,但是训练总是出现一个莫名其妙的错误,如下:

I0627 16:39:20.199623 19146 layer_factory.hpp:77] Creating layer input-data
I0627 16:39:20.203780 19146 net.cpp:100] Creating Layer input-data
I0627 16:39:20.203795 19146 net.cpp:418] input-data -> data
I0627 16:39:20.203801 19146 net.cpp:418] input-data -> im_info
I0627 16:39:20.203805 19146 net.cpp:418] input-data -> gt_boxes
./experiments/scripts/faster_rcnn_end2end.sh: 行 57: 19146 段错误               (核心已转储) ./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}

添加流程如下:

  1. 将softmax_focal_loss_layer.hpp放到include/caffe/layers里面
  2. 将softmax_focal_loss_layer.cpp, softmax_focal_loss_layer.cu放到src/caffe/layers里面
  3. 修改src/caffe/proto/caffe.proto文件,主要就是添加如下2个信息:   optional SoftmaxFocalLossParameter softmax_focal_loss_param = 555;

    message SoftmaxFocalLossParameter{ optional float alpha = 1 [default = 0.25]; optional float gamma = 2 [default = 2]; }

  4. make all -j8,make pycaffe

编译都没有问题,就是训练总报上述错误.

不知道您遇到过这种情况吗??   

foralliance commented 6 years ago

问题已解决,当我采用cmake编译时,就不出出现如上错误