shaqian / flutter_tflite

Flutter plugin for TensorFlow Lite
https://pub.dartlang.org/packages/tflite
MIT License
633 stars 408 forks source link

Cannot copy between a TensorFlowLite tensor with shape [1, 896, 16] and a Java object with shape [1, 896, 4] #109

Open finger-dy opened 4 years ago

finger-dy commented 4 years ago

SSDMobileNet How Can I set num_coords. ERR:Cannot copy between a TensorFlowLite tensor with shape [1, 896, 16] and a Java object with shape [1, 896, 4].

bytesList: img.planes.map((plane) { return plane.bytes; }).toList(), model: widget.model == yolo ? "YOLO" : "SSDMobileNet", imageHeight: img.height, imageWidth: img.width, imageMean: widget.model == yolo ? 0 : 127.5, imageStd: widget.model == yolo ? 255.0 : 127.5, numResultsPerClass: 1, threshold: widget.model == yolo ? 0.2 : 0.4,

LintonAchmad commented 4 years ago

Check that the model you using is the correct one. I ran into an error like this and turns out I was using a non SSD mobilenet model. The SSD function was bombing out because of that.