TypeError: memoryview: a bytes-like object is required, not 'str'

未关闭
#11,092 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@laxmareddyp 已经在做这个了。

开始于 2023年9月24日。

评估

这个 Issue 还没有评估数据。

描述

models:research type:support

File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\utils\label_map_util.py", line 175, in load_labelmap
text_format.Merge(label_map_string, label_map)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 719, in Merge
return MergeLines(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 793, in MergeLines
return parser.MergeLines(lines, message)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 818, in MergeLines
self._ParseOrMerge(lines, message)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 837, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 967, in _MergeField
merger(tokenizer, message, field)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 1042, in _MergeMessageField
self._MergeField(tokenizer, sub_message)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 953, in _MergeField
tokenizer.Consume(':')
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\text_format.py", line 1314, in Consume
raise self.ParseError('Expected "%s".' % token)
': Expected ":".text_format.ParseError: 2:4 : ' id=1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ \Desktop\Vscode\Ticketing\Tecent_Captcha\models\research\object_detection\model_main_tf2.py", line 114, in
tf.compat.v1.app.run()
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\absl\app.py", line 308, in run
_run_main(main, args)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\absl\app.py", line 254, in _run_main
sys.exit(main(argv))
File "C:\Users\ \Desktop\Vscode\Ticketing\Tecent_Captcha\models\research\object_detection\model_main_tf2.py", line 105, in main
model_lib_v2.train_loop(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\model_lib_v2.py", line 563, in train_loop
train_input = strategy.experimental_distribute_datasets_from_function(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\util\deprecation.py", line 357, in new_func
return func(*args, **kwargs)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\distribute_lib.py", line 1198, in experimental_distribute_datasets_from_function
return self.distribute_datasets_from_function(dataset_fn, options)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\distribute_lib.py", line 1189, in distribute_datasets_from_function
return self._extended._distribute_datasets_from_function( # pylint: disable=protected-access
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\mirrored_strategy.py", line 593, in _distribute_datasets_from_function
return input_util.get_distributed_datasets_from_function(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\input_util.py", line 132, in get_distributed_datasets_from_function
return input_lib.DistributedDatasetsFromFunction(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 1372, in init
self.build()
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 1393, in build
_create_datasets_from_function_with_input_context(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\tensorflow\python\distribute\input_lib.py", line 1875, in _create_datasets_from_function_with_input_context
dataset = dataset_fn(ctx)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\model_lib_v2.py", line 554, in train_dataset_fn
train_input = inputs.train_input(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\inputs.py", line 908, in train_input
dataset = INPUT_BUILDER_UTIL_MAP['dataset_build'](
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\builders\dataset_builder.py", line 209, in build
decoder = decoder_builder.build(input_reader_config)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\builders\decoder_builder.py", line 51, in build
decoder = tf_example_decoder.TfExampleDecoder(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 458, in init
_ClassTensorHandler(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 92, in init
name_to_id = label_map_util.get_label_map_dict(
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\utils\label_map_util.py", line 211, in get_label_map_dict
label_map = load_labelmap(label_map_path_or_proto)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\object_detection\utils\label_map_util.py", line 177, in load_labelmap
label_map.ParseFromString(label_map_string)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\message.py", line 199, in ParseFromString
return self.MergeFromString(serialized)
File "C:\Users\ .conda\envs\tf_tecent\lib\site-packages\google\protobuf\internal\python_message.py", line 1125, in MergeFromString
serialized = memoryview(serialized)
TypeError: memoryview: a bytes-like object is required, not 'str'
Does anyone know how to fix this?

主要语言
Python
星标
77.6k
派生
44.8k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/models 的其他 Issue

查看 tensorflow/models 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。