tensorflow / flutter-tflite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

null check operator used on a null value

NQHuy1905 opened this issue · comments

Hi, i am trying to deploy app with tflite_flutter.

But when i test the code like below, it, log out error null check operator used on a null value though as i see input and output of model is not null

Can anyone explain why

Screenshot from 2024-03-21 11-38-10

provide all code its not coming from the code you provide

I am having the same issue. The issue is coming from runForMultipleInputs() in interpreter.dart

Model: blaze_face_short_range.tflite

The interpreter outputShape is [1,896,16] but the outputTensors in runForMultipleInputs() is [ 2, 896, 16]

final output = [
            List.filled(896, List.filled(16, 0.0))
];
interpreter.run(input, output);

interpreter.dart:

void runForMultipleInputs(List<Object> inputs, Map<int, Object> outputs) {
   if (outputs.isEmpty) {
     throw ArgumentError('Input error: Outputs should not be null or empty.');
   }
   runInference(inputs);
   var outputTensors = getOutputTensors();
   for (var i = 0; i < outputTensors.length; i++) {
     outputTensors[i].copyTo(outputs[i]!);
   }
 }

This project is based off of the Image Segmentation example at https://github.com/tensorflow/flutter-tflite/tree/main/example/image_segmentation

lib.zip