All the tutorials I found on the Internet are to convert H5 model into tflite model, but I didn’t find that the directly trained model is tflite. What should I do if the trained model is tflite? Because I tried to convert H5 to tflite, but it seems that I lost a little more precision
You lose precision as normal TF model by default uses higher degree of precision for calculations (unit32) however post conversion to TFLite, it becomes slightly lower due to conversion of values to (unit8). As far conversion from H5Model to TFLite, that’s the way it is. I shared my personal experience, so accuracy will drop with TFLite but sole idea behind TFLite is to give inference using edge devices like Rasp Pi , Coral TPU etc, so its a tradeoff.
If you lose accuracy during conversion w/o quantization/pruning, that would be a bug. File an issue on TFLite repo w/ detailed steps to reproduce.
If you apply quantization/pruning, you should expect accuracy loss. You are basically trading accuracy for faster speed and smaller model size.