Closed InomjonRamatov closed 6 years ago
how to fix the issue??? please help
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in
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.
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.
@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!!
@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
@vivekbhadouria Thanks! problem has been solved by installing protobuf 3.4.0.
pip install -U protobuf
worked for me. It updated protobuf to v3.6
pip install -U protobuf
worked for me too. Thanks @keevee09 .
Thanks a lot @keevee09, it worked!
Do I need to rebuild tensorflow and install after upgrading to protobuf 3.6.0?
make sure to compile the Protobuf libraries again @Sawatdatta
Why protoc 3.4.0 doesn't work for me? (win10)
I still get TypeError: __new__() got an unexpected keyword argument 'serialized_options'
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
@SenhorCastor Just uninstall and then reinstall the protobuf.
sudo pip uninstall protobuf
sudo pip install -U protobuf
For me this worked!
@SenhorCastor只需卸载然后重新安装protobuf即可。
sudo pip uninstall protobuf sudo pip install -U protobuf
对我来说这很有效!
这对我来说还是不行
@hanlaoshi Please write in English!!!!
This is still not work for me.
This is still not work for me.
@hanlaoshi What error are you getting?
@hanlaoshi Please write in English!!!!
@Bahramudin use deep learning to translate. @hanlaoshi said, "This is still not good for me". I used Google Translate. 😅
@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.
Why pip install -U protobuf
is not useful for me?
Both tensorflow v1.10 and v1.11 have this problem. V1.8.0 works for me.
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'
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
@SenhorCastor Just uninstall and then reinstall the protobuf.
sudo pip uninstall protobuf sudo pip install -U protobuf
For me this worked! Thanksssssss
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
This is an issue with protobuf, read this comment please: https://github.com/protocolbuffers/protobuf/issues/4716#issuecomment-428293527
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 objectdetection_dot_protos_dot_gridanchorgeneratorpb2 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 objectdetection_dot_protos_dot_gridanchorgeneratorpb2 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
pip install -U protobuf worked for me too. Thanks @keevee09 .
You can either:
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
pip install -U protobuf
worked for me. It updated protobuf to v3.6
This worked for me too .. thank you for your help
Which version of ml-agents are you using ? @siddhartha-mukherjee-india
pip install -U protobuf Worked for me too.
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.
pip install -U protobuf It's work. thank you for your help
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.
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:
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
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.