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

google.protobuf.text_format.ParseError: 7:1 : Expected identifier or number, got <. #175

Open
shivansh2524 opened this issue Aug 17, 2018 · 7 comments

Comments

@shivansh2524
Copy link

shivansh2524 commented Aug 17, 2018

I am trying to convert googlenet pretrained on places365 dataset and getting the following error.
`

WARNING: PyCaffe not found!
Falling back to a pure protocol buffer implementation.
* Conversions will be drastically slower.
* This backend is UNTESTED!

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 "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in init
self.load(def_path, data_path, phase)
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 227, in load
graph = GraphBuilder(def_path, phase).build()
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/graph.py", line 140, in init
self.load()
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/graph.py", line 146, in load
text_format.Merge(def_file.read(), self.params)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 536, in Merge
descriptor_pool=descriptor_pool)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 590, in MergeLines
return parser.MergeLines(lines, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 623, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 638, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 706, in _MergeField
name = tokenizer.ConsumeIdentifierOrNumber()
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 1166, in ConsumeIdentifierOrNumber
raise self.ParseError('Expected identifier or number, got %s.' % result)
google.protobuf.text_format.ParseError: 7:1 : Expected identifier or number, got <.
`
I am using python2.7 with tensorflow 1.8.0
Is there a fix for this probelm?

@JiangYi0311
Copy link

could you tell me how to solve this problem in detail? thanks.

@ravi0531rp
Copy link

Has anyone solved this??

@aliakbar09a
Copy link

I am facing the same problem.

@maxsim-memetu
Copy link

I ran into this issue when downloading alexnet prototxt by wget from this url:
wget https://github.com/BVLC/caffe/blob/master/models/bvlc_alexnet/deploy.prototxt

the downloaded prototxt was an html file and so incurs a parser complaint.
I circumvented this issue by coping the raw contents from github and pasting them into an empty file.
It worked out.
Not sure if your problem has the same root cause.

@fridex
Copy link

fridex commented Apr 3, 2019

the downloaded prototxt was an html file and so incurs a parser complaint.

You can click on the "Raw" button to get raw file (without GitHub's html):

https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_alexnet/deploy.prototxt

@ozlemalci
Copy link

google.protobuf.text_format.ParseError: 7:1 : '': Expected identifier or number, got <.

I had the same problem. How do I solve it? Please help

@ozlemalci
Copy link

I am trying to convert googlenet pretrained on places365 dataset and getting the following error.

`

WARNING: PyCaffe not found!
Falling back to a pure protocol buffer implementation.
* Conversions will be drastically slower.
* This backend is UNTESTED!

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 "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in init
self.load(def_path, data_path, phase)
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 227, in load
graph = GraphBuilder(def_path, phase).build()
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/graph.py", line 140, in init
self.load()
File "/home/vsl5/Desktop/shivansh/internship/caffe2tf/caffe-tensorflow/kaffe/graph.py", line 146, in load
text_format.Merge(def_file.read(), self.params)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 536, in Merge
descriptor_pool=descriptor_pool)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 590, in MergeLines
return parser.MergeLines(lines, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 623, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 638, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 706, in _MergeField
name = tokenizer.ConsumeIdentifierOrNumber()
File "/home/vsl5/anaconda3/envs/pyth2_7/lib/python2.7/site-packages/google/protobuf/text_format.py", line 1166, in ConsumeIdentifierOrNumber
raise self.ParseError('Expected identifier or number, got %s.' % result)
google.protobuf.text_format.ParseError: 7:1 : Expected identifier or number, got <.
`
I am using python2.7 with tensorflow 1.8.0
Is there a fix for this probelm?

I had the same problem. did you solve?

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

7 participants