问题描述:

TypeError: __init__() got an unexpected keyword argument 'serialized_options'

  File "object_detection/builders/model_builder_test.py", line 24, in <module>
from object_detection.builders import model_builder
File "F:\File_Python\Python_example\models-master\research\object_detection\builders\model_builder.py", line 20, in <module>
from object_detection.builders import anchor_generator_builder
File "F:\File_Python\Python_example\models-master\research\object_detection\builders\anchor_generator_builder.py", line 21, in <module>
from object_detection.protos import anchor_generator_pb2
File "F:\File_Python\Python_example\models-master\research\object_detection\protos\anchor_generator_pb2.py", line 15, in <module>
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "F:\File_Python\Python_example\models-master\research\object_detection\protos\grid_anchor_generator_pb2.py", line 22, in <module>
serialized_pb=_b('\n3object_detection/protos/grid_anchor_generator.proto\x12\x17object_detection.protos\"\xcd\x01\n\x13GridAnchorGenerator\x12\x13\n\x06height\x18\x01 \x01(\x05:\x03\x32\x35\x36\x12\x12\n\x05width\x18\x02 \x01(\x05:\x03\x32\x35\x36\x12\x19\n\rheight_stride\x18\x03 \x01(\x05:\x02\x31\x36\x12\x18\n\x0cwidth_stride\x18\x04 \x01(\x05:\x02\x31\x36\x12\x18\n\rheight_offset\x18\x05 \x01(\x05:\x01\x30\x12\x17\n\x0cwidth_offset\x18\x06 \x01(\x05:\x01\x30\x12\x0e\n\x06scales\x18\x07 \x03(\x02\x12\x15\n\raspect_ratios\x18\x08 \x03(\x02')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

解决方法:

类型错误:__init__()得到意外的关键字参数“serialized_options”

出现该问题,很有可能是,终端上的 protoc 版本 与python库内的protobuf版本不一样。

安装对应版本的库即可!比如我的执行下列命令

pip install -U protobuf

pip安装时-U参数是什么作用?

pip install -h 就有说明了,就是 --upgrade,意思是如果已安装就升级到最新版。

-U 是升级 原来已经安装的包,如果有新版本,不带U不会装新版,带上才会更新到最新版本。

大功告成!完美解决!

TypeError: __init__() got an unexpected keyword argument 'serialized_options'的更多相关文章

  1. TypeError: __init__() got an unexpected keyword argument 't_command'

    python  .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...

  2. 关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument 'column' 的解决方案

    关于Jupyter Notebook无法自动补全(Autocompletion),报错TypeError: __init__() got an unexpected keyword argument ...

  3. Anacoda下报错conda command not found 以及TypeError: __new__() got an unexpected keyword argument 'serialized_options'

    在anacoda安装完成后,执行conda list命令,显示command not found 解决方法: 对于anaconda 2  , 输入export PATH=~/anaconda2/bin ...

  4. Django2.0——django-filter: TypeError at *** __init__() got an unexpected keyword argument 'name'

    在使用 Django2.0 版本的 Django Rest Framwork 时,Django DeBug 报错 django-filter: TypeError at *** __init__() ...

  5. senlin __init__() got an unexpected keyword argument 'additional_headers'

    从senlin源码重新编译更新了服务,然后执行 senlin的 cli就遇到了错误: __init__() got an unexpected keyword argument 'additional ...

  6. TypeError: parse() got an unexpected keyword argument 'transport_encoding'

    错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...

  7. TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

    错误: TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' 参照https://blog.c ...

  8. TypeError: to_categorical() got an unexpected keyword argument 'nb_classes'

    在学习莫烦教程中keras教程时,报错:TypeError: to_categorical() got an unexpected keyword argument 'nb_classes',代码如下 ...

  9. TypeError: pivot_table() got an unexpected keyword argument 'rows'

    利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...

随机推荐

  1. 在js中获取 input checkbox里选中的多个值

    思路:利用name属性值获取checkbox对象,然后循环判断checked属性(true表示被选中,false表示未选中).下面进行实例演示: 1.html中展示: <input type=& ...

  2. 关于b站爬虫的尝试(一)

    由于b站爬虫难度较小(url地址主要通过av定位),我第一的爬虫尝试就选择了b站 以下为初步的尝试. 首先,由于初步统计,b站空视频(已下架或者删除)的比例大概是百分之五十(统计样本基本在前几年的视频 ...

  3. mybatis注解大全

    注解 目标 相对应的 XML 描述 @CacheNamespace 类 <cache> 为给定的命名空间 (比如类) 配置缓存. 属性:implemetation,eviction, fl ...

  4. maven插件生成可执行jar包

    <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assem ...

  5. VO、DTO、POJO、PO的区别

    VO 即value object值对象.主要体现在视图的对象,对于一个WEB页面将整个页面的属性封装成一个对象.然后用一个VO对象在控制层与视图层进行传输交换. DTO 经过处理后的PO,可能增加或者 ...

  6. SpringBoot 测试类 @RunWith & @SpringBootTest

    @RunWith(SpringRunner.class) @SpringBootTest public class RabbitMqTest { @Autowired RabbitMqSender r ...

  7. 怎么把word文档粘贴到编辑器里啊?

    很多时候我们用一些管理系统的时候,发布新闻.公告等文字类信息时,希望能很快的将word里面的内容直接粘贴到富文本编辑器里面,然后发布出来.减少排版复杂的工作量. 下面是借用百度doc 来快速实现这个w ...

  8. BZOJ 2100: [Usaco2010 Dec]Apple Delivery spfa

    由于是无向图,所以可以枚举两个终点,跑两次最短路来更新答案. #include <queue> #include <cstdio> #include <cstring&g ...

  9. MIME协议(四) -- MIME消息的头字段

    MIME消息的头字段 4.1  Content-Type 对于表示某个具体资源的MIME消息,它的消息头中需要指定资源的数据类型:对于MIME组合消息,它的消息头中需要指定组合关系.具体资源的数据类型 ...

  10. P1439 【模板】最长公共子序列 LCS

    P1439 [模板]最长公共子序列 题解 1.RE的暴力DP O(n2) 我们设dp[i][j]表示,S串的第i个前缀和T串的第j个前缀的最长公共子序列. ◦          分情况: ◦      ...