原
AttributeError: 'module' object has no attribute 'text_format'
2017年05月19日 13:12:01
火腿肠的幸福生活
阅读数:8849
<span class="tags-box artic-tag-box">
<span class="label">标签:</span>
<a data-track-click="{"mod":"popu_626","con":"faster rcnn"}" class="tag-link" href="http://so.csdn.net/so/search/s.do?q=faster rcnn&t=blog" target="_blank">faster rcnn </a><a data-track-click="{"mod":"popu_626","con":"python"}" class="tag-link" href="http://so.csdn.net/so/search/s.do?q=python&t=blog" target="_blank">python </a>
<span class="article_info_click">更多</span></span>
<div class="tags-box space">
<span class="label">个人分类:</span>
<a class="tag-link" href="https://blog.csdn.net/qq_33202928/article/category/6927325" target="_blank">Faster RCNN </a>
</div>
</div>
<div class="operating">
</div>
</div>
</div>
</div>
<article class="baidu_pl">
<div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post">
<div class="article-copyright">
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33202928/article/details/72526710 </div>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-d7e2a68c7c.css">
<div class="htmledit_views" id="content_views">
最近在学习 faster rcnn ,本来环境已经配置好,已经跑完自己的程序,运行良好,后来安装了tensorflow,然后重新使用 faster rcnn 进行训练的时候居然出错了,我很纳闷,期间没有卸载或者修改配置文件啊,怎么会这样?
问题:
pb2.text_format.Merge(f.read(), self.solver_param) AttributeError: 'module' object has no attribute 'text_format'
经过google之后发现是protobuf的本版发生了变换,之前在配置caffe的时候手动安装了protbuf,版本是2.5.0,后来安装了tensorflow 我回忆了一下,protobuf的版本貌似是发生了变换。
所以解决办法:sudo pip install protobuf==2.5.0
刚才又发现一个新的解决方法:
在文件./lib/fast_rcnn/train.py增加一行import google.protobuf.text_format 即可解决问题