python - 类型错误:签名不匹配。键必须是 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
以前有人遇到过这个问题吗?
解决方案
推荐阅读
- php - PHP webshell 使用 wget 或 URL 传递值
- sql - 将表拆分为列并按日期分组
- asp.net - 已发布的 Blazor 服务器应用程序未在 Linux 上的 wwwroot 文件夹中提供 css
- unicode - OpenSceneGraph:如何检查 ogsText::Font 是否支持提供的字符?
- php - 在两个不同的 Stripe 帐户中创建或获取 Stripe 客户
- hdfs - Pyarrow fs.HadoopFileSytem 报告无法加载 libhdfs.so
- vue.js - 切换复选框时,VueJS子组件不会更新v-model
- python - 如何根据包含分号拆分 df 行;
- swagger - 自定义 Swagger 用户界面
- reactjs - 在 React Native 中获取 React CORS 预检错误