From f18a6002a935f2cadf6442aeba38f6916c2c61e7 Mon Sep 17 00:00:00 2001 From: Jeff Dong Date: Tue, 7 Jun 2016 16:09:59 +0800 Subject: [PATCH] fix python3 monitor bug --- python/mxnet/monitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/mxnet/monitor.py b/python/mxnet/monitor.py index 6fb84cc3ee55..4080aed61013 100644 --- a/python/mxnet/monitor.py +++ b/python/mxnet/monitor.py @@ -3,7 +3,7 @@ """Monitor outputs, weights, and gradients for debugging.""" import ctypes from .ndarray import NDArray -from .base import NDArrayHandle +from .base import NDArrayHandle, py_str from . import ndarray import logging from math import sqrt @@ -43,11 +43,11 @@ def asum_stat(x): self.sort = sort def stat_helper(name, array): """wrapper for executor callback""" - if not self.activated or not self.re_prog.match(name): + if not self.activated or not self.re_prog.match(py_str(name)): return array = ctypes.cast(array, NDArrayHandle) array = NDArray(array, writable=False) - self.queue.append((self.step, name, self.stat_func(array))) + self.queue.append((self.step, py_str(name), self.stat_func(array))) self.stat_helper = stat_helper def install(self, exe):