forked from mindspore-Ecosystem/mindspore
fix bug and add two tflite models
set quant_type default value
This commit is contained in:
parent
2b78032605
commit
1d601b6924
|
@ -78,9 +78,9 @@ hiai_cv_labelDetectorModel_v2.tflite
|
|||
#hiai_cv_labelDetectorModel_v3.tflite
|
||||
hiai_cv_labelDetectorModel_v4.tflite
|
||||
hiai_dress_detect.tflite
|
||||
#hiai_frozen_inference_graph.tflite
|
||||
hiai_frozen_inference_graph.tflite
|
||||
hiai_ghostnet.tflite
|
||||
hiai_iMaxDN_RGB.tflite
|
||||
hiai_iMaxSR_RGB.tflite
|
||||
hiai_label_and_video.tflite
|
||||
#hiai_lm_inference_graph.tflite
|
||||
hiai_lm_inference_graph.tflite
|
||||
|
|
|
@ -158,7 +158,7 @@ STATUS TfliteModelParser::ConvertTensor(const std::unique_ptr<tflite::SubGraphT>
|
|||
auto isConst = (!tensor_buffer->data.empty());
|
||||
if (isConst) {
|
||||
CopyConstTensorData(tflite_model_buffer, tflite_tensor.get(), tensor.get());
|
||||
} else if (tensor->dataType == TypeId::kNumberTypeUInt8) {
|
||||
} else if (quantType == QuantType_AwareTraining && tensor->dataType == TypeId::kNumberTypeUInt8) {
|
||||
// set in/out tensor to int8 to fit ms-lite op
|
||||
tensor->dataType = TypeId::kNumberTypeInt8;
|
||||
}
|
||||
|
@ -299,6 +299,7 @@ MetaGraphT *TfliteModelParser::Parse(const std::string &model_file,
|
|||
const QuantType &quant_type) {
|
||||
std::unique_ptr<schema::MetaGraphT> sub_graph = std::make_unique<schema::MetaGraphT>();
|
||||
sub_graph->name = "MS_model converted by TF-Lite";
|
||||
quantType = quant_type;
|
||||
|
||||
// load graph
|
||||
std::unique_ptr<tflite::ModelT> tflite_model = ReadTfliteModel(model_file.c_str());
|
||||
|
|
|
@ -77,6 +77,7 @@ class TfliteModelParser : public ModelParser {
|
|||
|
||||
std::map<std::string, schema::CNodeT *> opMap;
|
||||
std::map<const tflite::OperatorT *, schema::CNodeT *> tfliteOpMap;
|
||||
QuantType quantType = QuantType_QUANT_NONE;
|
||||
};
|
||||
} // namespace lite
|
||||
} // namespace mindspore
|
||||
|
|
Loading…
Reference in New Issue