提交 181e08ea authored 作者: Ian Goodfellow's avatar Ian Goodfellow

modified infer_shape failure message to include traceback of the error

上级 e821c2aa
...@@ -9,7 +9,7 @@ _logger = logging.getLogger('theano.tensor.opt') ...@@ -9,7 +9,7 @@ _logger = logging.getLogger('theano.tensor.opt')
import operator import operator
import itertools import itertools
import sys import sys
import traceback
import numpy import numpy
import numpy as N #guys... please don't do this in the library :( import numpy as N #guys... please don't do this in the library :(
...@@ -717,9 +717,9 @@ class ShapeFeature(object): ...@@ -717,9 +717,9 @@ class ShapeFeature(object):
except NotImplementedError: except NotImplementedError:
o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs]) o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs])
except Exception, e: except Exception, e:
_logger.error('Failed to infer_shape from Op %s (i_shapes=%s): %s %s'% (node.op, _logger.error('Failed to infer_shape from Op %s.\nInput shapes:%s\nException encountered during infer_shape: %s\nException message: %s\nTraceback: %s'% (node.op,
[self.shape_of[r] for r in node.inputs], [self.shape_of[r] for r in node.inputs],
type(e), str(e))) type(e), str(e), traceback.format_exc()))
o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs]) o_shapes = self.default_infer_shape(node, [self.shape_of[r] for r in node.inputs])
# this is packed information # this is packed information
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论