From 13c921aa9bd481897ce6c390cb5d1069ff1f2dee Mon Sep 17 00:00:00 2001
From: wuyefeilin <chenguowei01@baidu.com>
Date: Tue, 13 Sep 2022 16:05:15 +0800
Subject: [PATCH 1/3] add input_shape key to deploy.yaml

---
 Matting/tools/export.py | 3 ++-
 export.py               | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Matting/tools/export.py b/Matting/tools/export.py
index 3fe1a51c9e..ca58908dde 100644
--- a/Matting/tools/export.py
+++ b/Matting/tools/export.py
@@ -102,7 +102,8 @@ def main(args):
             'Deploy': {
                 'transforms': transforms,
                 'model': 'model.pdmodel',
-                'params': 'model.pdiparams'
+                'params': 'model.pdiparams',
+                'input_shape': shape
             }
         }
         yaml.dump(data, file)
diff --git a/export.py b/export.py
index 38c6aa7032..9f53b606da 100644
--- a/export.py
+++ b/export.py
@@ -134,7 +134,8 @@ def main(args):
                 'model': 'model.pdmodel',
                 'params': 'model.pdiparams',
                 'with_softmax': args.with_softmax,
-                'with_argmax': not args.without_argmax
+                'with_argmax': not args.without_argmax,
+                'input_shape': shape
             }
         }
         yaml.dump(data, file)

From 152b4990fb9673734155811fc5d849cf3bee8bcd Mon Sep 17 00:00:00 2001
From: wuyefeilin <chenguowei01@baidu.com>
Date: Mon, 19 Sep 2022 17:47:15 +0800
Subject: [PATCH 2/3] update val.py

---
 contrib/PanopticDeepLab/core/val.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/contrib/PanopticDeepLab/core/val.py b/contrib/PanopticDeepLab/core/val.py
index ccb4c328de..6c0aed4ea4 100644
--- a/contrib/PanopticDeepLab/core/val.py
+++ b/contrib/PanopticDeepLab/core/val.py
@@ -55,12 +55,7 @@ def evaluate(model,
     model.eval()
     nranks = paddle.distributed.ParallelEnv().nranks
     local_rank = paddle.distributed.ParallelEnv().local_rank
-    if nranks > 1:
-        # Initialize parallel environment if not done.
-        if not paddle.distributed.parallel.parallel_helper._is_parallel_ctx_initialized(
-        ):
-            paddle.distributed.init_parallel_env()
-    batch_sampler = paddle.io.DistributedBatchSampler(
+    batch_sampler = paddle.io.BatchSampler(
         eval_dataset, batch_size=1, shuffle=False, drop_last=False)
     loader = paddle.io.DataLoader(
         eval_dataset,

From af4335d3aa22a63753a1aa5ea11d0bd27894a34e Mon Sep 17 00:00:00 2001
From: wuyefeilin <chenguowei01@baidu.com>
Date: Thu, 22 Sep 2022 15:32:30 +0800
Subject: [PATCH 3/3] update cityscapes_panoptic.py

---
 contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py b/contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py
index d305ce3ea8..537fa9fada 100644
--- a/contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py
+++ b/contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py
@@ -60,6 +60,7 @@ class CityscapesPanoptic(paddle.io.Dataset):
         small_instance_weight (int, optional): The loss weight for small instance. Default: 1.
         stuff_area (int, optional): An Integer, remove stuff whose area is less tan stuff_area. Default: 2048.
     """
+    NUM_CLASSES = 19
 
     def __init__(self,
                  transforms,