diff --git a/ppcls/modeling/architectures/mobilenet_v3.py b/ppcls/modeling/architectures/mobilenet_v3.py index 60f29bf402ea4b27a0d966523684ef562c018e1c..9666c9b8287e2365bce4137a50ba33770cfd2684 100644 --- a/ppcls/modeling/architectures/mobilenet_v3.py +++ b/ppcls/modeling/architectures/mobilenet_v3.py @@ -23,7 +23,7 @@ import paddle.nn as nn import paddle.nn.functional as F from paddle.nn import Conv2d, BatchNorm, Linear, Dropout from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d -from paddle.regularizer import L2Decay +from paddle.fluid.regularizer import L2Decay import math diff --git a/ppcls/modeling/architectures/resnest.py b/ppcls/modeling/architectures/resnest.py index e175a16a33608b65bb34df2b6797e49e47cdaeb2..20ac4ddfd87c0daebd697277b638375981e3c6a1 100644 --- a/ppcls/modeling/architectures/resnest.py +++ b/ppcls/modeling/architectures/resnest.py @@ -24,7 +24,7 @@ from paddle import ParamAttr from paddle.nn.initializer import MSRA from paddle.nn import Conv2d, BatchNorm, Linear, Dropout from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d -from paddle.regularizer import L2Decay +from paddle.fluid.regularizer import L2Decay __all__ = ["ResNeSt50_fast_1s1x64d", "ResNeSt50"] diff --git a/ppcls/optimizer/optimizer.py b/ppcls/optimizer/optimizer.py index 9bb9c857ed156eaa23df2e3acf4ac201273c8bf0..dec619705655985ef27a714f82baaac14e8414dc 100644 --- a/ppcls/optimizer/optimizer.py +++ b/ppcls/optimizer/optimizer.py @@ -19,6 +19,7 @@ from __future__ import print_function import sys import paddle +import paddle.fluid.regularizer as regularizer __all__ = ['OptimizerBuilder'] @@ -36,7 +37,7 @@ class L1Decay(object): self.factor = factor def __call__(self): - reg = paddle.regularizer.L1Decay(self.factor) + reg = regularizer.L1Decay(self.factor) return reg @@ -53,7 +54,7 @@ class L2Decay(object): self.factor = factor def __call__(self): - reg = paddle.regularizer.L2Decay(self.factor) + reg = regularizer.L2Decay(self.factor) return reg diff --git a/ppcls/utils/check.py b/ppcls/utils/check.py index 0121c370e3a7035030c152a8e28ee877d32c2075..655fb7d328ff960d717522be014679fd9b76d922 100644 --- a/ppcls/utils/check.py +++ b/ppcls/utils/check.py @@ -37,7 +37,8 @@ def check_version(): "or a suitable develop version is satisfied as well. \n" \ "Please make sure the version is good with your code." try: - paddle.utils.require_version('0.0.0') + pass + # paddle.utils.require_version('0.0.0') except Exception: logger.error(err) sys.exit(1)