提交 10503cfa 编写于 作者: M Megvii Engine Team

fix(lite/load_and_run): fix load and run read mgv2 model invalid

GitOrigin-RevId: de53ff42f31e4e0e70925390eccc0a96c47972dc
上级 ad91f35e
...@@ -16,12 +16,14 @@ ModelType ModelBase::get_model_type(std::string model_path) { ...@@ -16,12 +16,14 @@ ModelType ModelBase::get_model_type(std::string model_path) {
// get model type // get model type
std::string tag(buf); std::string tag(buf);
std::string tagv2(&buf[8]);
ModelType type; ModelType type;
if (tag.substr(0, 7) == std::string("mgb0001") || if (tag.substr(0, 7) == std::string("mgb0001") ||
tag.substr(0, 8) == std::string("mgb0000a") || tag.substr(0, 8) == std::string("mgb0000a") ||
tag.substr(0, 4) == std::string("MGBS") || tag.substr(0, 4) == std::string("MGBS") ||
tag.substr(0, 4) == std::string("MGBC") || tag.substr(0, 4) == std::string("MGBC") ||
tag.substr(0, 8) == std::string("mgbtest0")) { tag.substr(0, 8) == std::string("mgbtest0") ||
tagv2.substr(0, 4) == std::string("mgv2")) {
type = ModelType::MEGDL_MODEL; type = ModelType::MEGDL_MODEL;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册