Faster-RCNN 训练自己数据集的坑记录

本文记录了使用Faster-RCNN在CPU上训练自定义数据集时遇到的错误及解决办法,包括VOCdevkit2007文件夹缺失、Caffe配置、.pkl文件问题、代码错误等,并提供了相应的解决方案。
摘要由CSDN通过智能技术生成

主要照这篇博客进行训练配置,因为没有GPU所以好多坑,CPU训练可以参见这篇博客

正所谓,跑通了的都一样,错误千万样。按照教程来也是坑多

训练:

 python train_faster_rcnn_alt_opt.py  --net_name ZF --weights /home/lys/py-faster-rcnn/data/imagenet_models/ZF.v2.caffemodel --cfg /home/lys/py-faster-rcnn/experiments/cfgs/faster_rcnn_alt_opt.yml  --imdb voc_2007_trainval



error1:

Cannot use GPU in CPU-only Caffe: check mode.

solution1:

把py-faster-rcnn/tools/下的所有py文件中的GPU注释掉,然后mode设为cpu。示例如下:

#    caffe.set_mode_gpu()
    caffe.set_mode_cpu()
#    if args.gpu_id is not None:
#        caffe.set_device(args.gpu_id)

error2:
Process Process-1:
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 "train_faster_rcnn_alt_opt.py", line 125, in train_rpn
    roidb, imdb = get_roidb(imdb_name)
  File "train_faster_rcnn_alt_opt.py", line 62, in get_roidb
    imdb = get_imdb(imdb_name)
  File "/home/lys/py-faster-rcnn/tools/../lib/datasets/factory.py", line 38, in get_imdb
    return __sets[name]()
  File "/home/lys/py-faster-rcnn/tools/../lib/datasets/factory.py", line 20, in <lambda>
    __sets[name] = (lambda split=split, year=year: pascal_voc(split, year))
  File "/home/lys/py-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 39, in __init__
    self._image_index = self._load_image_set_index()
  File "/home/lys/py-faster-rcnn/tools/../lib/datasets/pascal_voc.py", line 83, in _load_image_set_index
    'Path does not exist: {}'.format(image_set_file)
AssertionError: Path does not exist: /home/lys/py-faster-rcnn/data/VOCdevkit2007/VOC2007/ImageSets/Main/trainval.txt

solution2:

智障错误。只顾了查看trainval.txtz在不在了,没有创建VOCdevkit2007文件夹,直接就VOC2007了

error3:

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 "train_faster_rcnn_alt_opt.py", line 125, in train_rpn
    roidb, imdb = get_roidb(imdb_name)
  File "train_faster_rcnn_alt_opt.py", line 68, in get_roidb
    roidb = get_training_roidb(imd
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值