From a219455516f77b735c93621db16d26e8f230f5e7 Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Mon, 27 Feb 2017 13:45:47 +0800 Subject: [PATCH] Rise type error because of python. --- python/paddle/v2/trainer.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/paddle/v2/trainer.py b/python/paddle/v2/trainer.py index 023ab5e42d2..f65c631f7bf 100644 --- a/python/paddle/v2/trainer.py +++ b/python/paddle/v2/trainer.py @@ -164,20 +164,20 @@ def __check_train_args__(train_data_reader, topology, parameters, """ if not callable(train_data_reader) or not isinstance(train_data_reader(), collections.Iterator): - raise ValueError('train_data_reader should be a function, ' - 'which can return a iterator') + raise TypeError('train_data_reader should be a function, ' + 'which can return a iterator') if test_data_reader is not None: if not callable(test_data_reader) or not isinstance( test_data_reader(), collections.Iterator): - raise ValueError('test_data_reader should be a function, which can ' - 'return a iterator') + raise TypeError('test_data_reader should be a function, which can ' + 'return a iterator') if not isinstance(topology, ModelConfig): - raise ValueError('topology should be a model config') + raise TypeError('topology should be a model config') if not isinstance(parameters, v2_parameters.Parameters): - raise ValueError('parameters should be a parameter pool') + raise TypeError('parameters should be a parameter pool') if not callable(event_handler): - raise ValueError('event handler should be a function') + raise TypeError('event handler should be a function') -- GitLab