Firebase AutoML模型(model.tflite)运行良好,而我准备的模型的准确性却较低(from 99% before converting to 60% after converting
,尽管architecture is almost same.
可能是什么问题?
我使用tf.lite.TFLiteConverter
转换了模型。
我可以找到的唯一区别是在检查时:
我准备的模型中的quantization: 0 ≤ q ≤ 255
。
quantization: -1.0078740119934082 ≤ 0.007874015718698502 * (q - 128) ≤ 1
在firebase autoML模型中。...
这意味着什么?
也:
我在模型Firebase提供使用的同时使用了mobilenetv2_1.00_224/block_12_project_BN/FusedBatchNorm
module_apply_default/mnas_v4_a_1/feature_network/cell_9/op_0/project_0/add_fold
。
那就是我在检查时可以找到的所有区别。
我得到了95%的val精度,而Firebase是97%,它的模型工作正常,在手机上使用时不是我的。
from tensorflow import lite
converter = lite.TFLiteConverter.from_keras_model_file( 'mob_best.h5')
tfmodel = converter.convert()
converter.quantize = False
open ("f.tflite" , "wb") .write(tfmodel)
Google在做什么,但我做不到! 我使用Netron检查模型!