eliberis / tflite-tools

TFLite model analyzer & memory optimizer
MIT License
120 stars 20 forks source link

KeyError: 9 #2

Closed JacobLau84 closed 4 years ago

JacobLau84 commented 4 years ago

Traceback` (most recent call last): File "tflite_tools.py", line 55, in main() File "tflite_tools.py", line 35, in main model.print_model_analysis() File "/home/pi/tflite-tools/tflite_tools/tflite_model.py", line 402, in print_model_analysis self._print_tensor_details() File "/home/pi/tflite-tools/tflite_tools/tflite_model.py", line 329, in _print_tensor_details if t.size != 0: File "/home/pi/tflite-tools/tflite_tools/tflite_model.py", line 64, in size return 0 if self.is_constant else np.prod(self.shape) * get_buffer_element_size(self.type) File "/home/pi/tflite-tools/tflite_tools/tflite_model.py", line 47, in get_buffer_element_size return sizes[t] KeyError: 9

eliberis commented 4 years ago

Thanks, I updated it to support newer tflite models with the INT8 buffer data type (key = 9).