ValueError: Mobile SSD models are expected to have exactly 4 outputs, found 2
I created a dataset using roboflow, and trained it using the colab. I have done this once before and it worked, but with this model i keep getting the ValueError: Mobile SSD models are expected to have exactly 4 outputs, found 2 error.
I met the same error in android sample object_detection.
Closing and tracking in https://github.com/google-ai-edge/mediapipe-samples/issues/473
I am still confused on how to convert the model such that it gets the same 4 outputs I was initially giving. I also saved the model using model.export_model(model.export_model(model_name=model_out, quantization_config=quantization_config)
Can someone tell me how to convert the trained model to obtain the 4 output (locations, classes, scores, detections)?
I was trying to run inference in C++ using the following code but it failed due to output mismatch:
// https://www.tensorflow.org/lite/models/object_detection/overview#starter_model
TfLiteTensor *output_locations =
interpreter->tensor(interpreter->outputs()[0]);
TfLiteTensor *output_classes =
interpreter->tensor(interpreter->outputs()[1]);
TfLiteTensor *output_scores =
interpreter->tensor(interpreter->outputs()[2]);
TfLiteTensor *output_detections =
interpreter->tensor(interpreter->outputs()[3]);