mergin_bn.py error ,AttributeError: 'module' object has no attribute 'text_format' AttributeError: 'module' object has no attribute 'text_format'

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

最近在学习 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 即可解决问题

猜你喜欢

转载自blog.csdn.net/m0_37192554/article/details/85060727