东方耀AI技术分享

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3654|回复: 0

[课堂笔记] pb2.text_format.Merge(f.read(), self.solver_param) AttributeError: 'module' o...

[复制链接]

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14418
QQ
发表于 2019-8-10 17:01:50 | 显示全部楼层 |阅读模式

Traceback (most recent call last):
  File "./tools/train_net.py", line 124, in <module>
    max_iters=args.max_iters)
  File "/home/dfy888/py2_caffe_faster_rcnn_works/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 161, in train_net
    pretrained_model=pretrained_model)
  File "/home/dfy888/py2_caffe_faster_rcnn_works/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 52, in __init__
    pb2.text_format.Merge(f.read(), self.solver_param)
AttributeError: 'module' object has no attribute 'text_format'



当前环境已经安装了protobuf ==  3.9.1
import google.protobuf as pb2


解决:
18行后加上from google.protobuf import text_format
53行改为text_format.Merge(f.read(), self.solver_param)

google protobuf text_format.png
让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|人工智能工程师的摇篮 ( 湘ICP备2020019608号-1 )

GMT+8, 2024-3-28 21:12 , Processed in 0.200758 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表