LoginSignup
4
3

More than 5 years have passed since last update.

AutoML API呼び出し時エラー TypeError: __new__() got an unexpected keyword argument 'serialized_options'対処法

Posted at

AutoML API呼び出し時エラー

raceback (most recent call last):
  File "predict.py", line 4, in <module>
    from google.cloud import automl_v1beta1
  File "/anaconda3/lib/python3.6/site-packages/google/cloud/automl_v1beta1/__init__.py", line 19, in <module>
    from google.cloud.automl_v1beta1 import types

  File "/anaconda3/lib/python3.6/site-packages/google/cloud/automl_v1beta1/types.py", line 22, in <module>
    from google.api import http_pb2
  File "/anaconda3/lib/python3.6/site-packages/google/api/http_pb2.py", line 22, in <module>
    serialized_pb=_b('\n\x15google/api/http.proto\x12\ngoogle.api\"T\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18
\x02 \x01(\x08\"\x81\x02\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x1
2\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\
x07 \x01(\t\x12\x15\n\rresponse_body\x18\x0c \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\
x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x
02\x04GAPIb\x06proto3')
TypeError: __new__() got an unexpected keyword argument 'serialized_options'

以下の記事を参考に、protobufを3.6 に更新すれば解決したら解決しました。(自分のはprotobuf 3.5.2でした。。)
ObjectDetecionAPI TypeError: new() got an unexpected keyword argument 'serialized_options'

#コマンド
pip install -U protobuf

割とよく分かんないエラーだったので、記述しておきます。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3