diff --git a/python/paddle/incubate/hapi/tests/test_model.py b/python/paddle/incubate/hapi/tests/test_model.py index e49ec5651ff160fce0c80e8804b55b18baadd3c3..9753c1838d126f3f39aa057272d83a9c5f1ab6ad 100644 --- a/python/paddle/incubate/hapi/tests/test_model.py +++ b/python/paddle/incubate/hapi/tests/test_model.py @@ -23,8 +23,7 @@ import shutil import tempfile from paddle import fluid -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear -from paddle.fluid.dygraph.container import Sequential +from paddle.nn import Conv2D, Pool2D, Linear, ReLU, Sequential from paddle.fluid.dygraph.base import to_variable from paddle.incubate.hapi.model import Model, Input, set_device @@ -42,9 +41,11 @@ class LeNetDygraph(fluid.dygraph.Layer): self.features = Sequential( Conv2D( 1, 6, 3, stride=1, padding=1), + ReLU(), Pool2D(2, 'max', 2), Conv2D( 6, 16, 5, stride=1, padding=0), + ReLU(), Pool2D(2, 'max', 2)) if num_classes > 0: diff --git a/python/paddle/incubate/hapi/vision/models/lenet.py b/python/paddle/incubate/hapi/vision/models/lenet.py index c49addcb1fb2482b5dc92330df3094f68f95ac2f..45094119f0790283e6eeaabf01b312ac4ad50e8d 100644 --- a/python/paddle/incubate/hapi/vision/models/lenet.py +++ b/python/paddle/incubate/hapi/vision/models/lenet.py @@ -13,8 +13,7 @@ #limitations under the License. import paddle.fluid as fluid -from paddle.fluid.dygraph.nn import Conv2D, BatchNorm, Pool2D, Linear -from paddle.fluid.dygraph.container import Sequential +from paddle.nn import Conv2D, Pool2D, Linear, ReLU, Sequential from ...model import Model @@ -44,9 +43,11 @@ class LeNet(Model): self.features = Sequential( Conv2D( 1, 6, 3, stride=1, padding=1), + ReLU(), Pool2D(2, 'max', 2), Conv2D( 6, 16, 5, stride=1, padding=0), + ReLU(), Pool2D(2, 'max', 2)) if num_classes > 0: