zoukankan      html  css  js  c++  java
  • TypeError: __init__() got an unexpected keyword argument 'serialized_options'

     

    问题描述:

    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_PythonPython_examplemodels-master
    esearchobject_detectionuildersmodel_builder.py", line 20, in <module>
        from object_detection.builders import anchor_generator_builder
      File "F:File_PythonPython_examplemodels-master
    esearchobject_detectionuildersanchor_generator_builder.py", line 21, in <module>
        from object_detection.protos import anchor_generator_pb2
      File "F:File_PythonPython_examplemodels-master
    esearchobject_detectionprotosanchor_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_PythonPython_examplemodels-master
    esearchobject_detectionprotosgrid_anchor_generator_pb2.py", line 22, in <module>
        serialized_pb=_b('
    3object_detection/protos/grid_anchor_generator.protox12x17object_detection.protos"xcdx01
    x13GridAnchorGeneratorx12x13
    x06heightx18x01 x01(x05:x03x32x35x36x12x12
    x05widthx18x02 x01(x05:x03x32x35x36x12x19
    
    height_stridex18x03 x01(x05:x02x31x36x12x18
    x0cwidth_stridex18x04 x01(x05:x02x31x36x12x18
    
    height_offsetx18x05 x01(x05:x01x30x12x17
    x0cwidth_offsetx18x06 x01(x05:x01x30x12x0e
    x06scalesx18x07 x03(x02x12x15
    
    aspect_ratiosx18x08 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不会装新版,带上才会更新到最新版本。

     大功告成!完美解决!

    酒是穿肠毒药,色是刮骨钢刀,财是惹祸根苗,气是雷烟火炮。 不过,无酒毕竟不成席,无色世上人渐稀,无财何人早早起,无气处处惹人欺。 饮酒不醉量为高,见色不迷真英豪,不义之财君莫取,忍气饶人祸自消。 酒色财气四堵墙,人人都在里边藏,谁若跳到墙外边,不是神仙也寿长。 君听我一言:做人,量体裁衣。
  • 相关阅读:
    jQuery ajax中支持的数据类型
    行内元素与块级元素
    本地连接无法加载远程访问连接管理器服务,错误711
    SQL Server 两种判断表名是否存在且删除的方式
    SQL Server 2008 修改表名
    MySql5.1在Win7下的安装与重装问题的解决
    JavaScript关闭浏览器
    SQL Server 添加一条数据获取自动增长列的几种方法
    获取当前程序运行目录
    字符串的判断与替换
  • 原文地址:https://www.cnblogs.com/laosan007/p/11734077.html
Copyright © 2011-2022 走看看