From ff7a152d2cfcb296232c460c7185117c07233e4c Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Sat, 27 Jun 2020 17:09:39 -0700 Subject: [PATCH] fix string argument mismatch in GraphRuntimeCodegen (#5933) --- python/tvm/autotvm/task/relay_integration.py | 4 +++- src/relay/backend/graph_runtime_codegen.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/tvm/autotvm/task/relay_integration.py b/python/tvm/autotvm/task/relay_integration.py index 9751d90..9a43f2f 100644 --- a/python/tvm/autotvm/task/relay_integration.py +++ b/python/tvm/autotvm/task/relay_integration.py @@ -56,7 +56,9 @@ def _lower(mod, opt_mod, _ = relay.optimize(mod, target, params) grc = graph_runtime_codegen.GraphRuntimeCodegen(None, target) grc.codegen(opt_mod["main"]) - except tvm.TVMError: + except tvm.TVMError as e: + print("Get errors with GraphRuntimeCodegen for task extraction. " + "Fallback to VMCompiler. Error details:\n%s" % str(e)) compiler = relay.vm.VMCompiler() if params: compiler.set_params(params) diff --git a/src/relay/backend/graph_runtime_codegen.cc b/src/relay/backend/graph_runtime_codegen.cc index bc8b390..19e6770 100644 --- a/src/relay/backend/graph_runtime_codegen.cc +++ b/src/relay/backend/graph_runtime_codegen.cc @@ -587,7 +587,7 @@ class GraphRuntimeCodegenModule : public runtime::ModuleNode { }); } else if (name == "get_param_by_name") { return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { - std::string key = args[0]; + String key = args[0]; CHECK_GT(this->output_.params.count(key), 0); *rv = this->output_.params[key]; }); -- 2.7.4