diff --git a/python/dllib/src/bigdl/dllib/optim/optimizer.py b/python/dllib/src/bigdl/dllib/optim/optimizer.py index c3ea9b137bb..793b7cda31e 100644 --- a/python/dllib/src/bigdl/dllib/optim/optimizer.py +++ b/python/dllib/src/bigdl/dllib/optim/optimizer.py @@ -32,6 +32,7 @@ from bigdl.util.common import init_engine from bigdl.util.common import to_list from bigdl.dataset.dataset import * +import warnings if sys.version >= '3': long = int @@ -860,6 +861,8 @@ def __init__(self, :param end_trigger: when to end the optimization :param batch_size: training batch size """ + warnings.warn("You are recommended to use `create` method to create an optimizer.") + assert isinstance(training_rdd, RDD), "Only type of RDD is allowed" self.pvalue = DistriOptimizer(model, training_rdd, criterion,