提交 90c5838c 编写于 作者: V Vijay Vasudevan 提交者: TensorFlower Gardener

Add the tensor shape to the Exception string when the image doesnt match.

Change: 150251692
上级 19ef8215
......@@ -128,9 +128,11 @@ def _Check3DImage(image, require_static=True):
try:
image_shape = image.get_shape().with_rank(3)
except ValueError:
raise ValueError("'image' must be three-dimensional.")
raise ValueError("'image' (shape %s) must be three-dimensional." %
image.shape)
if require_static and not image_shape.is_fully_defined():
raise ValueError("'image' must be fully defined.")
raise ValueError("'image' (shape %s) must be fully defined." %
image_shape)
if any(x == 0 for x in image_shape):
raise ValueError("all dims of 'image.shape' must be > 0: %s" %
image_shape)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册