, 得到,python,object-detection,google-colaboratory,tensorflow2.0,faster-rcnn"/>

首页 > 解决方案 > 类型错误:签名不匹配。键必须是 dtype, 得到

问题描述

我正在尝试在 Google Colab 上使用 Tensorflow 对象检测 API。运行 model_main.py 时,我收到此错误。

/content/gdrive/My Drive/Colab Notebooks/models/models/research/object_detection/builders/dataset_builder.py:135 process_fn *
        处理的张量=解码器.解码(值)
    /content/gdrive/My Drive/Colab Notebooks/models/models/research/object_detection/data_decoders/tf_example_decoder.py:388 decode *
        张量=解码器。解码(序列化示例,项目=键)
    /usr/local/lib/python3.6/dist-packages/tensorflow_core/contrib/slim/python/slim/data/tfexample_decoder.py:524 解码
        output.append(handler.tensors_to_item(keys_to_tensors))
    /content/gdrive/My Drive/Colab Notebooks/models/models/research/object_detection/data_decoders/tf_example_decoder.py:129 tensors_to_item
        item = self._handler.tensors_to_item(keys_to_tensors)
    /content/gdrive/My Drive/Colab Notebooks/models/models/research/object_detection/data_decoders/tf_example_decoder.py:98 tensors_to_item
        返回 tf.maximum(self._name_to_id_table.lookup(unmapped_tensor),
    /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/lookup_ops.py:223 查找
        (self._key_dtype,keys.dtype))

    类型错误:签名不匹配。键必须是 dtype dtype: 'float32',得到 dtype: 'string'。

我已按照此博客中给出的确切程序进行操作。以下代码正在生成此错误。

!python object_detection/model_main.py \
--pipeline_config_path=object_detection/models/model/faster_rcnn_inception_v2_pets.config \
--model_dir=object_detection/models/model \
--num_train_steps=50000 \
--sample_1_of_n_eval_examples=1 \
--alsologtostderr

以前有人遇到过这个问题吗?

标签: pythonobject-detectiongoogle-colaboratorytensorflow2.0faster-rcnn

解决方案


推荐阅读