本文介绍了ParseError:172:3:消息类型为"object_detection.protos.TrainConfig".没有名为"fine_tune_checkpoint_version"的字段;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ParseError Traceback(最近一次通话最后一次)

中的

---->1 config = config_util.get_configs_from_pipeline_file(CONFIG_PATH)

〜\ appData \ Roaming \ Python \ Python37 \ site-packages \ object_detection \ utils \ config_util.py in get_configs_from_pipeline_file(pipeline_config_path,config_override)

  96,其中tf.io.gfile.GFile(pipeline_config_path,"r")为f:第97章 

--->98 text_format.Merge(proto_str,pipeline_config)

  99,如果config_override:100 text_format.Merge(config_override,pipeline_config) 

合并中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py(文本,消息,allow_unknown_extension,allow_field_number,descriptor_pool,allow_unknown_field)

  735 allow_field_number,第736章 

->737 allow_unknown_field = allow_unknown_field)

  738739 

C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py在MergeLines(行,消息,allow_unknown_extension,allow_field_number,descriptor_pool,allow_unknown_field)

  803 descriptor_pool = descriptor_pool,804 allow_unknown_field = allow_unknown_field) 

->805 return parser.MergeLines(lines,message)

  806807 

MergeLines(自身,行,消息)中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py

  828"将协议消息的文本表示合并到消息中.829 self._allow_multiple_scalars = True 

->830 self._ParseOrMerge(lines,message)

  831返回消息832 

_ParseOrMerge中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py(自身,行,消息)

  850标记器=标记器(str_lines)851而不是tokenizer.AtEnd(): 

->852 self._MergeField(令牌,消息)

  853第854章 

_MergeField中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py(自身,标记生成器,消息)

  980第981章 

->982合并(令牌,消息,字段)

  983984其他:#Proto字段未知. 

_MergeMes​​sageField(自身,令牌生成器,消息,字段)中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py

1055,如果tokenizer.AtEnd():

1056提高tokenizer.ParseErrorPreviousToken('Expected'%s'..'%(end_token,))

->1057 self._MergeField(tokenizer,sub_message)

1058

1059,如果is_map_entry:

_MergeField中的C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ google \ protobuf \ text_format.py(自身,标记生成器,消息)

  947引发tokenizer.ParseErrorPreviousToken(948'消息类型%s"没有名为%s"的字段.% 

->949(message_descriptor.full_name,name))950951 if field:

解决方案

pipeline.config 文件中删除 fine_tune_checkpoint_version 行(根据您发布的内容行172),然后再试一次

ParseError Traceback (most recent call last)

in

----> 1 config = config_util.get_configs_from_pipeline_file(CONFIG_PATH)

~\AppData\Roaming\Python\Python37\site-packages\object_detection\utils\config_util.py in get_configs_from_pipeline_file(pipeline_config_path, config_override)

 96   with tf.io.gfile.GFile(pipeline_config_path, "r") as f:

 97     proto_str = f.read()

---> 98 text_format.Merge(proto_str, pipeline_config)

 99   if config_override:

100     text_format.Merge(config_override, pipeline_config)

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in Merge(text, message, allow_unknown_extension, allow_field_number, descriptor_pool, allow_unknown_field)

735       allow_field_number,

736       descriptor_pool=descriptor_pool,

--> 737 allow_unknown_field=allow_unknown_field)

738

739

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in MergeLines(lines, message, allow_unknown_extension, allow_field_number, descriptor_pool, allow_unknown_field)

803                    descriptor_pool=descriptor_pool,

804                    allow_unknown_field=allow_unknown_field)

--> 805 return parser.MergeLines(lines, message)

806

807

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in MergeLines(self, lines, message)

828     """Merges a text representation of a protocol message into a message."""

829     self._allow_multiple_scalars = True

--> 830 self._ParseOrMerge(lines, message)

831     return message

832

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in _ParseOrMerge(self, lines, message)

850     tokenizer = Tokenizer(str_lines)

851     while not tokenizer.AtEnd():

--> 852 self._MergeField(tokenizer, message)

853

854   def _MergeField(self, tokenizer, message):

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in _MergeField(self, tokenizer, message)

980

981       else:

--> 982 merger(tokenizer, message, field)

983

984     else:  # Proto field is unknown.

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in _MergeMessageField(self, tokenizer, message, field)

1055 if tokenizer.AtEnd():

1056 raise tokenizer.ParseErrorPreviousToken('Expected "%s".' % (end_token,))

-> 1057 self._MergeField(tokenizer, sub_message)

1058

1059 if is_map_entry:

C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py in _MergeField(self, tokenizer, message)

947         raise tokenizer.ParseErrorPreviousToken(

948             'Message type "%s" has no field named "%s".' %

--> 949 (message_descriptor.full_name, name))950951 if field:

解决方案

Remove fine_tune_checkpoint_version line (line 172 according to what you posted) from the pipeline.config file and try again

这篇关于ParseError:172:3:消息类型为"object_detection.protos.TrainConfig".没有名为"fine_tune_checkpoint_version"的字段;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 16:31