AttributeError: 'module' object has no attribute 'text_format'

问题:

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 129, in train_rpn
    max_iters=max_iters)
  File "/home/lu/work/py-faster-rcnn2/tools/../lib/fast_rcnn/train.py", line 157, in train_net
    pretrained_model=pretrained_model)
  File "/home/lu/work/py-faster-rcnn2/tools/../lib/fast_rcnn/train.py", line 51, in __init__
    pb2.text_format.Merge(f.read(), self.solver_param)
AttributeError: 'module' object has no attribute 'text_format'

pb2.text_format.Merge(f.read(), self.solver_param) AttributeError: 'module' 

object has no attribute 'text_format'。

编译能通过,但是就是训练的时候出问题;最终的解决办法是:

在文件./lib/fast_rcnn/train.py增加一行import google.protobuf.text_format 即可

解决问题

 

F0628 21:11:11.389936  9218 net.cpp:829] Cannot copy param 0 weights from layer 'cls_score'; shape mismatch.  Source param shape is 2 2048 (4096); target param shape is 21 2048 (43008). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

将prototxt对应文件里,21改为自己训练的类别+1,84改为(自己训练的类别+1)*4

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值