Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got an unexpected keyword argument "serialized_options", centos 7 #3995

Closed
InomjonRamatov opened this issue Apr 17, 2018 · 39 comments
Closed
Assignees

Comments

@InomjonRamatov
Copy link

Please go to Stack Overflow for help and support:

http://stackoverflow.com/questions/tagged/tensorflow

Also, please understand that many of the models included in this repository are experimental and research-style code. If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • What is the top-level directory of the model you are using:
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • TensorFlow installed from (source or binary):
  • TensorFlow version (use command below):
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

@InomjonRamatov InomjonRamatov changed the title got an unexpected keyword argument "serialized_options" got an unexpected keyword argument "serialized_options", centos 7 Apr 17, 2018
@InomjonRamatov
Copy link
Author

how to fix the issue??? please help

@InomjonRamatov
Copy link
Author

Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in
from object_detection.builders import anchor_generator_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 21, in
from object_detection.protos import anchor_generator_pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 15, in
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/grid_anchor_generator_pb2.py", line 22, in
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: new() got an unexpected keyword argument 'serialized_options'
(py35) [root@localhost research]#
(py35) [root@localhost research]# python object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in
from object_detection.builders import anchor_generator_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 21, in
from object_detection.protos import anchor_generator_pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 15, in
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/grid_anchor_generator_pb2.py", line 22, in
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: new() got an unexpected keyword argument 'serialized_options'

@k-w-w
Copy link
Contributor

k-w-w commented Apr 17, 2018

I apologize, but I am having a hard time understanding what the problem is, where the problem is, and what version it affects. Please resubmit and pay attention to the issue template (https://github.com/tensorflow/tensorflow/issues/new). Please provide all the information it asks. Thank you.

@k-w-w k-w-w closed this as completed Apr 17, 2018
@vivekbhadouria
Copy link

I too had this issue when I was compiling my protobuf with protoc version 3.5.x. But, when I changed my protoc version to 3.4.0, the problem vanished.

@Bahramudin
Copy link

@vivekbhadouria how did you install the 3.4.0, I also have the same problem with object-detection-api, which lower version not working and newer version also not working, I think the middle version will work, so I don't know how to install 3.4.0, now the installed version is 3.5.1, not working, I have installed it from source. Thanks!!

@vivekbhadouria
Copy link

vivekbhadouria commented May 10, 2018

@Bahramudin If I remember correctly then I first removed the protoc installed on my machine, then you install the required version i.e. 3.4.0.
Can you try below mentioned commands to install? I remember I noted these lines from SO but I forgot the link

# Grab the version you need
curl -OL https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip
# Unzip
unzip protoc-3.4.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/

After performing above steps, please run protoc --version to cross-check the installation. HTH

@Bahramudin
Copy link

@vivekbhadouria Thanks! problem has been solved by installing protobuf 3.4.0.

@keevee09
Copy link

pip install -U protobuf

worked for me. It updated protobuf to v3.6

@MuhammedBuyukkinaci
Copy link

pip install -U protobuf worked for me too. Thanks @keevee09 .

@roffel
Copy link
Contributor

roffel commented Jul 5, 2018

Thanks a lot @keevee09, it worked!

@Sawatdatta
Copy link

Do I need to rebuild tensorflow and install after upgrading to protobuf 3.6.0?

@sujaybabruwad
Copy link

make sure to compile the Protobuf libraries again @Sawatdatta

@JackShaw2333
Copy link

JackShaw2333 commented Aug 6, 2018

Why protoc 3.4.0 doesn't work for me? (win10)
I still get TypeError: __new__() got an unexpected keyword argument 'serialized_options'

@SenhorCastor
Copy link

SenhorCastor commented Aug 11, 2018

Same here:

protoc --version
libprotoc 3.4.0

bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
...
...
INFO: Found 1 target...
ERROR: /Users/fernandomartin/projects/tensorflow/tensorflow/BUILD:581:1: Executing genrule //tensorflow:tensorflow_python_api_gen failed (Exit 1)
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in <module>
    from tensorflow.python.tools.api.generator import doc_srcs
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/core/framework/graph_pb2.py", line 15, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/core/framework/node_def_pb2.py", line 15, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/core/framework/attr_value_pb2.py", line 15, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/core/framework/tensor_pb2.py", line 15, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "/private/var/tmp/_bazel_fernandomartin/86a50f68aec4b46d60ac0b40b849c4a9/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api.runfiles/org_tensorflow/tensorflow/core/framework/resource_handle_pb2.py", line 22, in <module>
    serialized_pb=_b('\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.960s, Critical Path: 0.45s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

macOs 10.13.16
python 2.7.13

@RahulBhalley
Copy link

@SenhorCastor Just uninstall and then reinstall the protobuf.

sudo pip uninstall protobuf
sudo pip install -U protobuf

For me this worked!

@hanlaoshi
Copy link

@SenhorCastor只需卸载然后重新安装protobuf即可

sudo pip uninstall protobuf
sudo pip install -U protobuf

对我来说这很有效!

这对我来说还是不行

@Bahramudin
Copy link

@hanlaoshi Please write in English!!!!

@hanlaoshi
Copy link

This is still not work for me.

@RahulBhalley
Copy link

This is still not work for me.

@hanlaoshi What error are you getting?

@RahulBhalley
Copy link

@hanlaoshi Please write in English!!!!

@Bahramudin use deep learning to translate. @hanlaoshi said, "This is still not good for me". I used Google Translate. 😅

@wei-v-wang
Copy link
Contributor

wei-v-wang commented Oct 22, 2018

@hanlaoshi Try "sudo pip uninstall protobuf", then "pip install protobuf" without sudo.
In my case, protobuf was installed with default root account and I had to issue "pip uninstall" with and without sudo.
Then make sure you have one protobuf version (google/protobuf installed in TF installation directory).
If you have errors like below
"ImportError: No module named google.protobuf"
create a "__init__.py" under google directory.

Tested with TF v1.11 and needed the above workaround.

@Arlenmbx
Copy link

Why pip install -U protobuf is not useful for me?

@Arlenmbx
Copy link

Both tensorflow v1.10 and v1.11 have this problem. V1.8.0 works for me.

@loretoparisi
Copy link

I'm having the same issue with TF v1.8 and protobuf

(.env) ip-192-168-22-127:Wave-U-Net loretoparisi$ pip show protobuf
Name: protobuf
Version: 3.6.1
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: None
Author-email: None
License: 3-Clause BSD License
Location: /Library/Python/2.7/site-packages
Requires: six, setuptools
Required-by: tensorflow, tensorboard
(.env) ip-192-168-22-127:Wave-U-Net loretoparisi$ pip show tensorflow
Name: tensorflow
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /Library/Python/2.7/site-packages
Requires: enum34, keras-preprocessing, wheel, astor, backports.weakref, mock, tensorboard, termcolor, protobuf, gast, absl-py, grpcio, six, keras-applications, numpy
Required-by: 
env) ip-192-168-22-127:Wave-U-Net loretoparisi$ python Predict.py with cfg.baseline_stereo
Traceback (most recent call last):
  File "Predict.py", line 3, in <module>
    import Evaluate
  File "/Users/loretoparisi/Documents/Projects/AI/Wave-U-Net/Evaluate.py", line 2, in <module>
    import tensorflow as tf
  File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 59, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 15, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/node_def_pb2.py", line 15, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 15, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/tensor_pb2.py", line 15, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/resource_handle_pb2.py", line 22, in <module>
    serialized_pb=_b('\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

@lugq1990
Copy link

lugq1990 commented Dec 7, 2018

I also encounter this problem. For me use protobuf=3.6.0 will work(previous is 3.6.1).
pip install protobuf==3.6.0

@samiarja
Copy link

@SenhorCastor Just uninstall and then reinstall the protobuf.

sudo pip uninstall protobuf
sudo pip install -U protobuf

For me this worked! Thanksssssss

@yuanxiangxie
Copy link

yuanxiangxie commented Dec 28, 2018

I'm having the same issue with TF v1.8 and protobuf

(.env) ip-192-168-22-127:Wave-U-Net loretoparisi$ pip show protobuf
Name: protobuf
Version: 3.6.1
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: None
Author-email: None
License: 3-Clause BSD License
Location: /Library/Python/2.7/site-packages
Requires: six, setuptools
Required-by: tensorflow, tensorboard
(.env) ip-192-168-22-127:Wave-U-Net loretoparisi$ pip show tensorflow
Name: tensorflow
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /Library/Python/2.7/site-packages
Requires: enum34, keras-preprocessing, wheel, astor, backports.weakref, mock, tensorboard, termcolor, protobuf, gast, absl-py, grpcio, six, keras-applications, numpy
Required-by: 
env) ip-192-168-22-127:Wave-U-Net loretoparisi$ python Predict.py with cfg.baseline_stereo
Traceback (most recent call last):
  File "Predict.py", line 3, in <module>
    import Evaluate
  File "/Users/loretoparisi/Documents/Projects/AI/Wave-U-Net/Evaluate.py", line 2, in <module>
    import tensorflow as tf
  File "/Library/Python/2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Library/Python/2.7/site-packages/tensorflow/python/__init__.py", line 59, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 15, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/node_def_pb2.py", line 15, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 15, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/tensor_pb2.py", line 15, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "/Library/Python/2.7/site-packages/tensorflow/core/framework/resource_handle_pb2.py", line 22, in <module>
    serialized_pb=_b('\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

Hi,I have the same problem, but downgrade tensorflow to 1.9.0, and it worked

@ghost
Copy link

ghost commented Feb 13, 2019

This is an issue with protobuf, read this comment please: protocolbuffers/protobuf#4716 (comment)

@iodncookie
Copy link

Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in
from object_detection.builders import anchor_generator_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 21, in
from object_detection.protos import anchor_generator_pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 15, in
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/grid_anchor_generator_pb2.py", line 22, in
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: new() got an unexpected keyword argument 'serialized_options'
(py35) [root@localhost research]#
(py35) [root@localhost research]# python object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
from object_detection.builders import model_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in
from object_detection.builders import anchor_generator_builder
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 21, in
from object_detection.protos import anchor_generator_pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 15, in
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/root/anaconda3/envs/py35/lib/python3.5/site-packages/object_detection-0.1-py3.5.egg/object_detection/protos/grid_anchor_generator_pb2.py", line 22, in
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: new() got an unexpected keyword argument 'serialized_options'

pip install -U protobuf

@jainsanmati
Copy link

pip install -U protobuf worked for me too. Thanks @keevee09 .

@danintel
Copy link

You can either:

  1. upgrade to Protobuf 3.6.0 or
  2. hand delete the "serialized_options=None," argument from the generated *_pb2.py files.

@Usmaniatech
Copy link

Unityagents support protobuf==3.5.2 and unity mlagents supports protobuf>=3.6,<3.7
I require both unityagents and mlagents. How do I fix this

@siddhartha-mukherjee-india
pip install -U protobuf

worked for me. It updated protobuf to v3.6

This worked for me too .. thank you for your help

@Usmaniatech
Copy link

Which version of ml-agents are you using ? @siddhartha-mukherjee-india

@harshaljaiswal
Copy link

pip install -U protobuf
Worked for me too.

@Usmaniatech
Copy link

pip install -U protobuf
Worked for me too.

Yes it works. But I was trying to work with greater version than 0.4.0 of MLAgents. It don't work their.

@TaDucToan
Copy link

pip install -U protobuf
It's work. thank you for your help

@estathop
Copy link

pip install -U protobuf

worked for me. It updated protobuf to v3.6

pip3 install -U protobuf

also worked for me, thank you a lot.

@jiaohuix
Copy link

jiaohuix commented Mar 2, 2024

keevee09

thanks a lot, it works for me!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests