Commit 3dd7d646 by masahi Committed by Tianqi Chen

dump lowered IR when debug logging (#292)

* dump lowered ir when debug log

* avoid calling tvm.lower() twice when not debug
parent 8473e9fa
...@@ -101,6 +101,7 @@ def _lower(sch, inputs, func_name, graph): ...@@ -101,6 +101,7 @@ def _lower(sch, inputs, func_name, graph):
try: try:
f = tvm.lower(sch, inputs, name=func_name) f = tvm.lower(sch, inputs, name=func_name)
logging.debug("lower function %s", func_name) logging.debug("lower function %s", func_name)
logging.debug("%s", tvm.lower(sch, inputs, simple_mode=True))
except Exception: except Exception:
msg = traceback.format_exc() msg = traceback.format_exc()
msg += "Error during compile graph\n" msg += "Error during compile graph\n"
......
...@@ -68,7 +68,7 @@ def get_symbol(num_classes, num_layers=11, batch_norm=False, dtype='float32'): ...@@ -68,7 +68,7 @@ def get_symbol(num_classes, num_layers=11, batch_norm=False, dtype='float32'):
13: ([2, 2, 2, 2, 2], [64, 128, 256, 512, 512]), 13: ([2, 2, 2, 2, 2], [64, 128, 256, 512, 512]),
16: ([2, 2, 3, 3, 3], [64, 128, 256, 512, 512]), 16: ([2, 2, 3, 3, 3], [64, 128, 256, 512, 512]),
19: ([2, 2, 4, 4, 4], [64, 128, 256, 512, 512])} 19: ([2, 2, 4, 4, 4], [64, 128, 256, 512, 512])}
if not vgg_spec.has_key(num_layers): if num_layers not in vgg_spec:
raise ValueError("Invalide num_layers {}. Choices are 11,13,16,19.".format(num_layers)) raise ValueError("Invalide num_layers {}. Choices are 11,13,16,19.".format(num_layers))
layers, filters = vgg_spec[num_layers] layers, filters = vgg_spec[num_layers]
data = sym.Variable(name="data") data = sym.Variable(name="data")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment