Browse Source

fix fmk and model type

tags/v1.1.0
yankai 5 years ago
parent
commit
c2accce119
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      mindspore/lite/tools/converter/converter.cc

+ 9
- 0
mindspore/lite/tools/converter/converter.cc View File

@@ -33,6 +33,7 @@
#include "proto/onnx.pb.h"
#include "tools/converter/quantizer/post_training_quantizer.h"
#include "tools/converter/quantizer/quant_cast.h"
#include "tools/common//graph_util.h"
#include "include/version.h"

namespace mindspore {
@@ -127,7 +128,15 @@ int RunConverter(int argc, const char **argv) {
switch (flags->fmk) {
case FmkType::FmkType_MS: {
auto graph = std::make_shared<FuncGraph>();
if (RET_OK != ValidateFileStr(flags->modelFile, ".mindir")) {
MS_LOG(ERROR) << "Input illegal: modelFile must be *.mindir";
return RET_INPUT_PARAM_INVALID;
}
auto onnx_graph = AnfImporterFromProtobuf::ReadOnnxFromBinary(flags->modelFile);
if (onnx_graph == nullptr) {
MS_LOG(ERROR) << "Read MINDIR model from binary failed";
return RET_INPUT_PARAM_INVALID;
}
MindsporeImporter mindsporeImporter(onnx_graph, graph);
fb_graph = mindsporeImporter.Convert(flags.get());
delete onnx_graph;


Loading…
Cancel
Save