models icon indicating copy to clipboard operation
models copied to clipboard

google.protobuf.text_format.ParseError: 110:25 : Expected string but found: '“'

Open johnsonlegend opened this issue 9 years ago • 38 comments

It looks like I have some problems when specifying my PATH_TO_BE_CONFIGURED, but I follows the tutorial and don't get what's wrong with my file path.

fine_tune_checkpoint: “/Users/johson/Data/Tensorflow/Models/object_detection/samples/checkpoints/faster_rcnn_resnet101_coco_11_06_2017/model.ckpt"

python object_detection/train.py
--logtostderr
--pipeline_config_path=object_detection/samples/configs/faster_rcnn_resnet101_pets.config
--train_dir=object_detection/models/model/train Traceback (most recent call last): File "object_detection/train.py", line 198, in tf.app.run() File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "object_detection/train.py", line 143, in main model_config, train_config, input_config = get_configs_from_pipeline_file() File "object_detection/train.py", line 103, in get_configs_from_pipeline_file text_format.Merge(f.read(), pipeline_config) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 476, in Merge descriptor_pool=descriptor_pool) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 526, in MergeLines return parser.MergeLines(lines, message) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 559, in MergeLines self._ParseOrMerge(lines, message) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 574, in _ParseOrMerge self._MergeField(tokenizer, message) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 675, in _MergeField merger(tokenizer, message, field) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 764, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 675, in _MergeField merger(tokenizer, message, field) File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 809, in _MergeScalarField value = tokenizer.ConsumeString() File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1151, in ConsumeString the_bytes = self.ConsumeByteString() File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1166, in ConsumeByteString the_list = [self._ConsumeSingleByteString()] File "/Users/johson/anaconda3/envs/envy/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1185, in _ConsumeSingleByteString raise self.ParseError('Expected string but found: %r' % (text,)) google.protobuf.text_format.ParseError: 133:19 : Expected string but found: '“'

johnsonlegend avatar Jul 08 '17 19:07 johnsonlegend

Solved. It's some quotation marks issues with Textedit.

johnsonlegend avatar Jul 08 '17 20:07 johnsonlegend

@johnsonlegend How did you solved this? I have a very similar issue.

google.protobuf.text_format.ParseError: 112:25 : Expected string but found: '/'

XYAskWhy avatar Jul 29 '17 08:07 XYAskWhy

Sloved. It was a mistake in the .config file.

XYAskWhy avatar Jul 29 '17 11:07 XYAskWhy

@XYAskWhy what type of mistake was that ? Kindly elaborate.

RakeshChandran avatar Aug 03 '17 13:08 RakeshChandran

I forgot the " ' ' " in one of the PATH_TO_BE_CONFIGUREDs. @RakeshChandran

XYAskWhy avatar Aug 03 '17 13:08 XYAskWhy

Thank you for your response @XYAskWhy .. In my case it was a \n and \t operator in the path name.

RakeshChandran avatar Aug 06 '17 07:08 RakeshChandran

@XYAskWhy , @johnsonlegend @RakeshChandran I have this problem when I run train.py in object_detection. This is what I get "TypeError: Expected string, got ['data/train.records'] of type 'RepeatedScalarFieldContainer' instead." I have repleased all path_to_be_configured parts properly. Could you please advise?

pooyan1983 avatar Nov 02 '17 07:11 pooyan1983

i have also the same issue

ngksai93 avatar Feb 26 '18 23:02 ngksai93

/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "object_detection/train.py", line 167, in tf.app.run() File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "object_detection/train.py", line 92, in main FLAGS.pipeline_config_path) File "/home/gopalakrishna/work/models-master/research/object_detection/utils/config_util.py", line 88, in get_configs_from_pipeline_file text_format.Merge(proto_str, pipeline_config) File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 533, in Merge descriptor_pool=descriptor_pool) File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 587, in MergeLines return parser.MergeLines(lines, message) File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 620, in MergeLines self._ParseOrMerge(lines, message) File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 635, in _ParseOrMerge self._MergeField(tokenizer, message) File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 679, in _MergeField name = tokenizer.ConsumeIdentifierOrNumber() File "/home/gopalakrishna/anaconda2/lib/python2.7/site-packages/google/protobuf/text_format.py", line 1152, in ConsumeIdentifierOrNumber raise self.ParseError('Expected identifier or number, got %s.' % result) google.protobuf.text_format.ParseError: 186:1 : Expected identifier or number, got ''.

please help me

ngksai93 avatar Feb 27 '18 16:02 ngksai93

Hi! found a solution. I checked my label files with small Linux command-line program "file", the result was:

broken.pbtxt: UTF-8 Unicode (with BOM) text, with CRLF line terminators
working.pbtxt: ASCII text

So when you editing your files keep track of it.

Hopefully it helps

pixx1 avatar Mar 05 '18 15:03 pixx1

I faced a similar problem relating to label_map_path when running on local machine. Solved by removing spaces between lines in the label map pbtxt file.

aawgit avatar Jul 23 '18 16:07 aawgit

i faced a problem when running train.py for object detection..my error is like this:

doe@doe:~/anaconda3/envs/tensorflow/models/research/object_detection$ python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config WARNING:tensorflow:From /home/doe/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py:124: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. Traceback (most recent call last): File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1500, in _ParseAbstractInteger return int(text, 0) ValueError: invalid literal for int() with base 0: '03'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1449, in _ConsumeInteger result = ParseInteger(tokenizer.token, is_signed=is_signed, is_long=is_long) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1471, in ParseInteger result = _ParseAbstractInteger(text, is_long=is_long) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1502, in _ParseAbstractInteger raise ValueError('Couldn't parse integer: %s' % text) ValueError: Couldn't parse integer: 03

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "train.py", line 184, in tf.app.run() File "/home/doe/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "/home/doe/anaconda3/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 136, in new_func return func(*args, **kwargs) File "train.py", line 94, in main FLAGS.pipeline_config_path) File "/home/doe/anaconda3/envs/tensorflow/models/research/object_detection/utils/config_util.py", line 94, in get_configs_from_pipeline_file text_format.Merge(proto_str, pipeline_config) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 536, in Merge descriptor_pool=descriptor_pool) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 590, in MergeLines return parser.MergeLines(lines, message) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 623, in MergeLines self._ParseOrMerge(lines, message) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 638, in _ParseOrMerge self._MergeField(tokenizer, message) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 837, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 837, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 871, in _MergeScalarField value = _ConsumeInt32(tokenizer) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1362, in _ConsumeInt32 return _ConsumeInteger(tokenizer, is_signed=True, is_long=False) File "/home/doe/.local/lib/python3.6/site-packages/google/protobuf/text_format.py", line 1451, in _ConsumeInteger raise tokenizer.ParseError(str(e)) google.protobuf.text_format.ParseError: 9:18 : Couldn't parse integer: 03

Asrix-AI avatar Aug 04 '18 13:08 Asrix-AI

@pixx1 can you elaborate on your solution?

dscha09 avatar Aug 16 '18 05:08 dscha09

@johnsonlegend how did you solve it? what did you do exactly?

dscha09 avatar Aug 16 '18 05:08 dscha09

@ruksin not quite sure about you file. But it sais

"ValueError: Couldn't parse integer: 03"

is there something wrong with your label_map? Maybe you wrote id: 03 insteat of id: 3?

@chaine09 Maybe there was a problem with line break: https://stackoverflow.com/questions/1552749/difference-between-cr-lf-lf-and-cr-line-break-types#1552775

pixx1 avatar Aug 22 '18 13:08 pixx1

(tensorflow1) C:\tensorflow1\models\research\object_detection>python train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config WARNING:tensorflow:From D:\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py:125: main (from main) is deprecated and will be removed in a future version. Instructions for updating: Use object_detection/model_main.py. Traceback (most recent call last): File "train.py", line 184, in tf.app.run() File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\util\deprecation.py", line 272, in new_func return func(*args, **kwargs) File "train.py", line 93, in main FLAGS.pipeline_config_path) File "C:\tensorflow1\models\research\object_detection\utils\config_util.py", line 94, in get_configs_from_pipeline_file text_format.Merge(proto_str, pipeline_config) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 536, in Merge descriptor_pool=descriptor_pool) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 590, in MergeLines return parser.MergeLines(lines, message) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 623, in MergeLines self._ParseOrMerge(lines, message) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 638, in _ParseOrMerge self._MergeField(tokenizer, message) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 837, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 763, in _MergeField merger(tokenizer, message, field) File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 888, in _MergeScalarField value = tokenizer.ConsumeString() File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 1251, in ConsumeString the_bytes = self.ConsumeByteString() File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 1266, in ConsumeByteString the_list = [self._ConsumeSingleByteString()] File "D:\Anaconda3\envs\tensorflow1\lib\site-packages\google\protobuf\text_format.py", line 1285, in _ConsumeSingleByteString raise self.ParseError('Expected string but found: %r' % (text,)) google.protobuf.text_format.ParseError: 106:23 : Expected string but found: '“'

請問遇到上面這個問題要怎麼解決? 謝謝

tcai5633 avatar Sep 11 '18 08:09 tcai5633

I'm getting the below error. please do help.

google.protobuf.text_format.ParseError: 158:3 : Message type "object_detection.protos.TrainConfig" has no field named "load_all_detection_checkpoint_vars".

ai-deepak avatar Sep 14 '18 07:09 ai-deepak

@ravikd123 I'm getting the same error as well. Were you able to fix it?

MalharJ avatar Sep 24 '18 20:09 MalharJ

I had encountered same problem and fix it by removing all comments in the top of the config file

qwertyDvo avatar Oct 06 '18 11:10 qwertyDvo

I had encountered same problem and fix it by removing all comments in the top of the config file

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

wanglidog avatar Oct 07 '18 15:10 wanglidog