diff --git a/python/paddle/optimizer/lr.py b/python/paddle/optimizer/lr.py index 528fab1c2b98dc419bc3e76fe84b49e95b947f6b..d0d5eef03c42c032c7593998aeccae65ca5767fc 100644 --- a/python/paddle/optimizer/lr.py +++ b/python/paddle/optimizer/lr.py @@ -1360,6 +1360,8 @@ class ReduceOnPlateau(LRScheduler): if not _in_legacy_dygraph(): tmp = core.eager.Tensor else: + # need to declarate explicitly + from paddle.framework import VarBase as Tensor tmp = Tensor # loss must be float, numpy.ndarray or 1-D Tensor with shape [1] if isinstance(metrics, (tmp, numpy.ndarray)):