fix string argument mismatch in GraphRuntimeCodegen (#5933)
authorLianmin Zheng <lianminzheng@gmail.com>
Sun, 28 Jun 2020 00:09:39 +0000 (17:09 -0700)
committerGitHub <noreply@github.com>
Sun, 28 Jun 2020 00:09:39 +0000 (17:09 -0700)
python/tvm/autotvm/task/relay_integration.py
src/relay/backend/graph_runtime_codegen.cc

index 9751d90..9a43f2f 100644 (file)
@@ -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)
index bc8b390..19e6770 100644 (file)
@@ -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];
       });