TFLite-Object-Detection-with-TFLite-Model-Maker icon indicating copy to clipboard operation
TFLite-Object-Detection-with-TFLite-Model-Maker copied to clipboard

getting "list index out of range" error

Open tanmay-18 opened this issue 1 year ago • 0 comments

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
[<ipython-input-5-13aae2c79e61>](https://localhost:8080/#) in <cell line: 9>()
      7 
      8 # Run inference and draw detection result on the local copy of the original file
----> 9 detection_result_image = run_odt_and_draw_results(
     10     INPUT_IMAGE_URL,
     11     interpreter,

2 frames
[<ipython-input-1-e5b13d81f88d>](https://localhost:8080/#) in get_output_tensor(interpreter, index)
     36 def get_output_tensor(interpreter, index):
     37   """Retur the output tensor at the given index."""
---> 38   output_details = interpreter.get_output_details()[index]
     39   tensor = np.squeeze(interpreter.get_tensor(output_details['index']))
     40   return tensor

IndexError: list index out of range

when i tried to print index and interpreter.get_output_details() the output was-

0
[{'name': 'Identity', 'index': 408, 'shape': array([   1,    9, 8400], dtype=int32), 'shape_signature': array([   1,    9, 8400], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}]
1
[{'name': 'Identity', 'index': 408, 'shape': array([   1,    9, 8400], dtype=int32), 'shape_signature': array([   1,    9, 8400], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0), 'quantization_parameters': {'scales': array([], dtype=float32), 'zero_points': array([], dtype=int32), 'quantized_dimension': 0}, 'sparsity_parameters': {}}]

tanmay-18 avatar Jul 12 '23 06:07 tanmay-18