Faster R-CNN训练问题解决

本日志记录了Faster R-CNN模型的训练过程,包括模型初始化、预训练权重加载及训练中遇到的具体错误。展示了网络各层是否需要进行反向传播计算的状态,并提到了从ImageNet预训练模型加载权重时忽略了一些特定层。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I0924 21:22:46.263638 13538 net.cpp:228] rpn_cls_score does not need backward computation.
I0924 21:22:46.263639 13538 net.cpp:228] rpn_conv1_rpn_relu1_0_split does not need backward computation.
I0924 21:22:46.263641 13538 net.cpp:228] rpn_relu1 does not need backward computation.
I0924 21:22:46.263643 13538 net.cpp:228] rpn_conv1 does not need backward computation.
I0924 21:22:46.263644 13538 net.cpp:226] loss_bbox needs backward computation.
I0924 21:22:46.263648 13538 net.cpp:226] loss_cls needs backward computation.
I0924 21:22:46.263649 13538 net.cpp:226] bbox_pred needs backward computation.
I0924 21:22:46.263651 13538 net.cpp:226] cls_score needs backward computation.
I0924 21:22:46.263653 13538 net.cpp:226] fc7_drop7_0_split needs backward computation.
I0924 21:22:46.263655 13538 net.cpp:226] drop7 needs backward computation.
I0924 21:22:46.263656 13538 net.cpp:226] relu7 needs backward computation.
I0924 21:22:46.263659 13538 net.cpp:226] fc7 needs backward computation.
I0924 21:22:46.263659 13538 net.cpp:226] drop6 needs backward computation.
I0924 21:22:46.263661 13538 net.cpp:226] relu6 needs backward computation.
I0924 21:22:46.263662 13538 net.cpp:226] fc6 needs backward computation.
I0924 21:22:46.263664 13538 net.cpp:226] roi_pool_conv5 needs backward computation.
I0924 21:22:46.263666 13538 net.cpp:226] conv5_relu5_0_split needs backward computation.
I0924 21:22:46.263669 13538 net.cpp:226] relu5 needs backward computation.
I0924 21:22:46.263670 13538 net.cpp:226] conv5 needs backward computation.
I0924 21:22:46.263671 13538 net.cpp:226] relu4 needs backward computation.
I0924 21:22:46.263674 13538 net.cpp:226] conv4 needs backward computation.
I0924 21:22:46.263674 13538 net.cpp:226] relu3 needs backward computation.
I0924 21:22:46.263676 13538 net.cpp:226] conv3 needs backward computation.
I0924 21:22:46.263677 13538 net.cpp:226] pool2 needs backward computation.
I0924 21:22:46.263679 13538 net.cpp:226] norm2 needs backward computation.
I0924 21:22:46.263681 13538 net.cpp:226] relu2 needs backward computation.
I0924 21:22:46.263684 13538 net.cpp:226] conv2 needs backward computation.
I0924 21:22:46.263684 13538 net.cpp:226] pool1 needs backward computation.
I0924 21:22:46.263686 13538 net.cpp:226] norm1 needs backward computation.
I0924 21:22:46.263689 13538 net.cpp:226] relu1 needs backward computation.
I0924 21:22:46.263689 13538 net.cpp:226] conv1 needs backward computation.
I0924 21:22:46.263692 13538 net.cpp:228] data does not need backward computation.
I0924 21:22:46.263695 13538 net.cpp:270] This network produces output bbox_loss
I0924 21:22:46.263695 13538 net.cpp:270] This network produces output cls_loss
I0924 21:22:46.263710 13538 net.cpp:283] Network initialization done.
I0924 21:22:46.263782 13538 solver.cpp:60] Solver scaffolding done.
Loading pretrained model weights from data/imagenet_models/ZF.v2.caffemodel
I0924 21:22:46.328830 13538 net.cpp:816] Ignoring source layer pool5_spm6
I0924 21:22:46.328847 13538 net.cpp:816] Ignoring source layer pool5_spm6_flatten
I0924 21:22:46.357678 13538 net.cpp:816] Ignoring source layer fc8
I0924 21:22:46.357684 13538 net.cpp:816] Ignoring source layer prob
Solving...
/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py:100: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  fg_inds, size=fg_rois_per_this_image, replace=False)
/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py:113: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  bg_inds, size=bg_rois_per_this_image, replace=False)
/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py:120: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  labels[fg_rois_per_this_image:] = 0
/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py:176: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
  bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
Process Process-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "./tools/train_faster_rcnn_alt_opt.py", line 195, in train_fast_rcnn
    max_iters=max_iters)
  File "/home/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 160, in train_net
    model_paths = sw.train_model(max_iters)
  File "/home/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 101, in train_model
    self.solver.step(1)
  File "/home/py-faster-rcnn/tools/../lib/roi_data_layer/layer.py", line 144, in forward
    blobs = self._get_next_minibatch()
  File "/home/py-faster-rcnn/tools/../lib/roi_data_layer/layer.py", line 63, in _get_next_minibatch
    return get_minibatch(minibatch_db, self._num_classes)
  File "/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 55, in get_minibatch
    num_classes)
  File "/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 125, in _sample_rois
    roidb['bbox_targets'][keep_inds, :], num_classes)
  File "/home/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 176, in _get_bbox_regression_labels
    bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
ValueError: could not broadcast input array from shape (4) into shape (0)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值