File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
tensorflow_model_optimization/python/core/quantization/keras Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -645,17 +645,15 @@ def testFixInputOutputRangeModel(
645
645
646
646
converter = tf .lite .TFLiteConverter .from_keras_model (fixed_range_model )
647
647
converter .optimizations = [tf .lite .Optimize .DEFAULT ]
648
- converter .inference_input_type = tf .int8
649
- converter .inference_output_type = tf .int8
650
648
tflite_model = converter .convert ()
651
649
interpreter = tf .lite .Interpreter (model_content = tflite_model )
652
650
653
- input_detail = interpreter .get_input_details ()[0 ]
651
+ input_detail = interpreter .get_tensor_details ()[1 ]
654
652
input_quantization_parameters = input_detail ['quantization_parameters' ]
655
653
input_scales = input_quantization_parameters ['scales' ]
656
654
input_zero_points = input_quantization_parameters ['zero_points' ]
657
655
658
- output_detail = interpreter .get_output_details ()[0 ]
656
+ output_detail = interpreter .get_tensor_details ()[- 2 ]
659
657
output_quantization_parameters = output_detail ['quantization_parameters' ]
660
658
output_scales = output_quantization_parameters ['scales' ]
661
659
output_zero_points = output_quantization_parameters ['zero_points' ]
You can’t perform that action at this time.
0 commit comments