tensorflow / tensorflow/tflite-support

Running ObjectDetectorWriter.create_for_inference received KeyError: 701

Open
#745 6 comments 0 reactions 1 assignee View on GitHub

@lu-wang-g is already working on this.

Since Feb 20, 2022.

Dominant language
C++
Stars
441
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Model I use: ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8

Running

writer = ObjectDetectorWriter.create_for_inference( writer_utils.load_file(_MODEL_PATH), [127.5], [127.5], [_LABEL_FILE])writer_utils.save_file(writer.populate(), _SAVE_TO_PATH),
received following error

KeyError                                  Traceback (most recent call last)
[<ipython-input-60-0a9a5c3c8853>](https://localhost:8080/#) in <module>()
      9 
     10 writer = ObjectDetectorWriter.create_for_inference(
---> 11     writer_utils.load_file(_MODEL_PATH), [127.5], [127.5], [_LABEL_FILE])
     12 writer_utils.save_file(writer.populate(), _SAVE_TO_PATH)
     13 

2 frames
[/usr/local/lib/python3.7/dist-packages/tensorflow_lite_support/metadata/python/metadata_writers/object_detector.py](https://localhost:8080/#) in <listcomp>(.0)
    210 
    211     # Output metadata according to output_tensor_indices.
--> 212     output_metadata = [indices_to_tensors[i] for i in output_tensor_indices]
    213 
    214     # Create subgraph info.

KeyError: 701

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.