From 8b69c1348c17cf7aca83aacc2c63ef9eaad97467 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Wed, 28 Jun 2017 10:34:22 +0800 Subject: [PATCH] check shape of vector input, should not be a scalar --- paddle/py_paddle/dataprovider_converter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/py_paddle/dataprovider_converter.py b/paddle/py_paddle/dataprovider_converter.py index f8242d9f7bc..7df4a6967fc 100644 --- a/paddle/py_paddle/dataprovider_converter.py +++ b/paddle/py_paddle/dataprovider_converter.py @@ -110,9 +110,9 @@ class DenseScanner(IScanner): raise ValueError( "The dimension of input cannot be greater than 3.") if len(self.__shape__) == 0: - self.__dim__ = 1 - else: - self.__dim__ = reduce(lambda x, y: x * y, self.__shape__) + raise ValueError( + "The input should be a vector, please check your input data.") + self.__dim__ = reduce(lambda x, y: x * y, self.__shape__) if len(self.__shape__) == 1 and self.__dim__ != self.input_type.dim: raise ValueError( "The data size must be equal to it in data layer.") -- GitLab