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

Protobuf error - truncated message #64

Closed
woodthom2 opened this issue Oct 3, 2016 · 5 comments
Closed

Protobuf error - truncated message #64

woodthom2 opened this issue Oct 3, 2016 · 5 comments

Comments

@woodthom2
Copy link

Hi

I am running TensorFlow 0.11.0rc0 on Python 3.5 with Mac OSX 10.11.6 and libprotoc 2.6.1.

When I try to convert a model (new Caffe format) I get this Protobuf error...
Has anyone seen this before?

Traceback (most recent call last):
File "convert.py", line 60, in
main()
File "convert.py", line 56, in main
args.phase)
File "convert.py", line 27, in convert
transformer = TensorFlowTransformer(def_path, caffemodel_path, phase=phase)
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in init
self.load(def_path, data_path, phase)
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 227, in load
graph = GraphBuilder(def_path, phase).build()
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/graph.py", line 140, in init
self.load()
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/graph.py", line 144, in load
self.params = get_caffe_resolver().NetParameter()
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/caffe/resolver.py", line 32, in get_caffe_resolver
SHARED_CAFFE_RESOLVER = CaffeResolver()
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/caffe/resolver.py", line 7, in init
self.import_caffe()
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/caffe/resolver.py", line 17, in import_caffe
from . import caffepb
File "/Users/thomaswood/Documents/Clones/caffe-tensorflow/kaffe/caffe/caffepb.py", line 799, in
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\020\001')),
File "/Users/thomaswood/anaconda/envs/py35/lib/python3.5/site-packages/google/protobuf/descriptor.py", line 872, in _ParseOptions
message.ParseFromString(string)
File "/Users/thomaswood/anaconda/envs/py35/lib/python3.5/site-packages/google/protobuf/message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "/Users/thomaswood/anaconda/envs/py35/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1088, in MergeFromString
raise message_mod.DecodeError('Truncated message.')

@woodthom2
Copy link
Author

OK I switched to Python 2 with the default TensorFlow installation in Anaconda, and it worked:

https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation

@woodthom2
Copy link
Author

I closed it but it may be worth keeping an eye on the issue as more people start using Python 3.

@wangchuan
Copy link

Same issue here, because I am using TensorFlow in Windows, where Python3 has to be used instead of Python2. This issue stops me using this project. T_T.

@jleni
Copy link

jleni commented Oct 11, 2017

It is likely that this is the issue affecting you
protocolbuffers/protobuf#3734

@ivanzhovannik
Copy link

If you have such a problem using different Python versions or using Windows consider running it with Docker:

https://github.com/nicolov/segmentation_keras/tree/master/conversion
https://github.com/ivanzhovannik/convert_caffe_windows

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

4 participants