We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
deeplabv3+ eval 报维度错误
在paddle1.5分支下，deeplabv3+ 的评估有如下报错：
Traceback (most recent call last):
  File "./eval.py", line 131, in <module>
    fetch_list=[pred, miou, out_wrong, out_correct])
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/executor.py", line 650, in run
    use_program_cache=use_program_cache)
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/executor.py", line 748, in _run
    exe.run(program.desc, scope, 0, True, True, fetch_var_name)
paddle.fluid.core_avx.EnforceNotMet: Invoke operator bilinear_interp error.
Python Callstacks:
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/framework.py", line 1699, in append_op
    attrs=kwargs.get("attrs", None))
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
    return self.main_program.current_block().append_op(*args, **kwargs)
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layers/nn.py", line 7637, in image_resize
    attrs=attrs)
  File "/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layers/nn.py", line 7742, in resize_bilinear
    align_corners, align_mode)
  File "./eval.py", line 84, in <module>
    img = fluid.layers.resize_bilinear(img, image_shape)
C++ Callstacks:
Enforce failed. Expected dim_x.size() == 4, but received dim_x.size():3 != 4:4.
X's dimension must be 4 at [/ssd1/xiege/paddle_ce/Paddle/paddle/fluid/operators/interpolate_op.cc:40]

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `PaddleCV/deeplabv3+/eval.py`
Content:
```
1 from __future__ import absolute_import
2 from __future__ import division
3 from __future__ import print_function
4 import os
5 if 'FLAGS_fraction_of_gpu_memory_to_use' not in os.environ:
6     os.environ['FLAGS_fraction_of_gpu_memory_to_use'] = '0.98'
7 os.environ['FLAGS_enable_parallel_graph'] = '1'
8 
9 import paddle
10 import paddle.fluid as fluid
11 import numpy as np
12 import argparse
13 from reader import CityscapeDataset
14 import reader
15 import models
16 import sys
17 import utility
18 
19 parser = argparse.ArgumentParser()
20 add_arg = lambda *args: utility.add_arguments(*args, argparser=parser)
21 
22 # yapf: disable
23 add_arg('total_step',           int,    -1,     "Number of the step to be evaluated, -1 for full evaluation.")
24 add_arg('init_weights_path',    str,    None,   "Path of the weights to evaluate.")
25 add_arg('dataset_path',         str,    None,   "Cityscape dataset path.")
26 add_arg('use_gpu',              bool,   True,   "Whether use GPU or CPU.")
27 add_arg('num_classes',          int,    19,     "Number of classes.")
28 add_arg('use_py_reader',        bool,   True,   "Use py_reader.")
29 add_arg('norm_type',            str,    'bn',   "Normalization type, should be 'bn' or 'gn'.")
30 #yapf: enable
31 
32 
33 def mean_iou(pred, label):
34     label = fluid.layers.elementwise_min(
35         label, fluid.layers.assign(np.array(
36             [num_classes], dtype=np.int32)))
37     label_ignore = (label == num_classes).astype('int32')
38     label_nignore = (label != num_classes).astype('int32')
39 
40     pred = pred * label_nignore + label_ignore * num_classes
41 
42     miou, wrong, correct = fluid.layers.mean_iou(pred, label, num_classes + 1)
43     return miou, wrong, correct
44 
45 
46 def load_model():
47     if os.path.isdir(args.init_weights_path):
48         fluid.io.load_params(
49             exe, dirname=args.init_weights_path, main_program=tp)
50     else:
51         fluid.io.load_params(
52             exe, dirname="", filename=args.init_weights_path, main_program=tp)
53 
54 
55 CityscapeDataset = reader.CityscapeDataset
56 
57 args = parser.parse_args()
58 
59 models.clean()
60 models.is_train = False
61 models.default_norm_type = args.norm_type
62 deeplabv3p = models.deeplabv3p
63 
64 image_shape = [1025, 2049]
65 eval_shape = [1024, 2048]
66 
67 sp = fluid.Program()
68 tp = fluid.Program()
69 batch_size = 1
70 reader.default_config['crop_size'] = -1
71 reader.default_config['shuffle'] = False
72 num_classes = args.num_classes
73 
74 with fluid.program_guard(tp, sp):
75     if args.use_py_reader:
76         py_reader = fluid.layers.py_reader(capacity=64,
77                                         shapes=[[1, 3, 0, 0], [1] + eval_shape],
78                                         dtypes=['float32', 'int32'])
79         img, label = fluid.layers.read_file(py_reader)
80     else:
81         img = fluid.layers.data(name='img', shape=[3, 0, 0], dtype='float32')
82         label = fluid.layers.data(name='label', shape=eval_shape, dtype='int32')
83 
84     img = fluid.layers.resize_bilinear(img, image_shape)
85     logit = deeplabv3p(img)
86     logit = fluid.layers.resize_bilinear(logit, eval_shape)
87     pred = fluid.layers.argmax(logit, axis=1).astype('int32')
88     miou, out_wrong, out_correct = mean_iou(pred, label)
89 
90 tp = tp.clone(True)
91 fluid.memory_optimize(
92     tp,
93     print_log=False,
94     skip_opt_set=set([pred.name, miou, out_wrong, out_correct]),
95     level=1)
96 
97 place = fluid.CPUPlace()
98 if args.use_gpu:
99     place = fluid.CUDAPlace(0)
100 exe = fluid.Executor(place)
101 exe.run(sp)
102 
103 if args.init_weights_path:
104     print("load from:", args.init_weights_path)
105     load_model()
106 
107 dataset = CityscapeDataset(args.dataset_path, 'val')
108 if args.total_step == -1:
109     total_step = len(dataset.label_files)
110 else:
111     total_step = args.total_step
112 
113 batches = dataset.get_batch_generator(batch_size, total_step)
114 if args.use_py_reader:
115     py_reader.decorate_tensor_provider(lambda :[ (yield b[1],b[2]) for b in batches])
116     py_reader.start()
117 
118 sum_iou = 0
119 all_correct = np.array([0], dtype=np.int64)
120 all_wrong = np.array([0], dtype=np.int64)
121 
122 for i in range(total_step):
123     if not args.use_py_reader:
124         _, imgs, labels, names = next(batches)
125         result = exe.run(tp,
126                          feed={'img': imgs,
127                                'label': labels},
128                          fetch_list=[pred, miou, out_wrong, out_correct])
129     else:
130         result = exe.run(tp,
131                          fetch_list=[pred, miou, out_wrong, out_correct])
132 
133     wrong = result[2][:-1] + all_wrong
134     right = result[3][:-1] + all_correct
135     all_wrong = wrong.copy()
136     all_correct = right.copy()
137     mp = (wrong + right) != 0
138     miou2 = np.mean((right[mp] * 1.0 / (right[mp] + wrong[mp])))
139     print('step: %s, mIoU: %s' % (i + 1, miou2))
140
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/PaddleCV/deeplabv3+/eval.py b/PaddleCV/deeplabv3+/eval.py
--- a/PaddleCV/deeplabv3+/eval.py
+++ b/PaddleCV/deeplabv3+/eval.py
@@ -112,7 +112,7 @@
 
 batches = dataset.get_batch_generator(batch_size, total_step)
 if args.use_py_reader:
-    py_reader.decorate_tensor_provider(lambda :[ (yield b[1],b[2]) for b in batches])
+    py_reader.decorate_tensor_provider(lambda :[ (yield b[0],b[1]) for b in batches])
     py_reader.start()
 
 sum_iou = 0
@@ -137,3 +137,5 @@
     mp = (wrong + right) != 0
     miou2 = np.mean((right[mp] * 1.0 / (right[mp] + wrong[mp])))
     print('step: %s, mIoU: %s' % (i + 1, miou2))
+
+print('eval done!')

{"golden_diff": "diff --git a/PaddleCV/deeplabv3+/eval.py b/PaddleCV/deeplabv3+/eval.py\n--- a/PaddleCV/deeplabv3+/eval.py\n+++ b/PaddleCV/deeplabv3+/eval.py\n@@ -112,7 +112,7 @@\n \n batches = dataset.get_batch_generator(batch_size, total_step)\n if args.use_py_reader:\n-    py_reader.decorate_tensor_provider(lambda :[ (yield b[1],b[2]) for b in batches])\n+    py_reader.decorate_tensor_provider(lambda :[ (yield b[0],b[1]) for b in batches])\n     py_reader.start()\n \n sum_iou = 0\n@@ -137,3 +137,5 @@\n     mp = (wrong + right) != 0\n     miou2 = np.mean((right[mp] * 1.0 / (right[mp] + wrong[mp])))\n     print('step: %s, mIoU: %s' % (i + 1, miou2))\n+\n+print('eval done!')\n", "issue": "deeplabv3+ eval \u62a5\u7ef4\u5ea6\u9519\u8bef\n\u5728paddle1.5\u5206\u652f\u4e0b\uff0cdeeplabv3+ \u7684\u8bc4\u4f30\u6709\u5982\u4e0b\u62a5\u9519\uff1a\r\nTraceback (most recent call last):\r\n  File \"./eval.py\", line 131, in <module>\r\n    fetch_list=[pred, miou, out_wrong, out_correct])\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/executor.py\", line 650, in run\r\n    use_program_cache=use_program_cache)\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/executor.py\", line 748, in _run\r\n    exe.run(program.desc, scope, 0, True, True, fetch_var_name)\r\npaddle.fluid.core_avx.EnforceNotMet: Invoke operator bilinear_interp error.\r\nPython Callstacks:\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/framework.py\", line 1699, in append_op\r\n    attrs=kwargs.get(\"attrs\", None))\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layer_helper.py\", line 43, in append_op\r\n    return self.main_program.current_block().append_op(*args, **kwargs)\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layers/nn.py\", line 7637, in image_resize\r\n    attrs=attrs)\r\n  File \"/opt/_internal/cpython-3.6.0/lib/python3.6/site-packages/paddle/fluid/layers/nn.py\", line 7742, in resize_bilinear\r\n    align_corners, align_mode)\r\n  File \"./eval.py\", line 84, in <module>\r\n    img = fluid.layers.resize_bilinear(img, image_shape)\r\nC++ Callstacks:\r\nEnforce failed. Expected dim_x.size() == 4, but received dim_x.size():3 != 4:4.\r\nX's dimension must be 4 at [/ssd1/xiege/paddle_ce/Paddle/paddle/fluid/operators/interpolate_op.cc:40]\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nif 'FLAGS_fraction_of_gpu_memory_to_use' not in os.environ:\n    os.environ['FLAGS_fraction_of_gpu_memory_to_use'] = '0.98'\nos.environ['FLAGS_enable_parallel_graph'] = '1'\n\nimport paddle\nimport paddle.fluid as fluid\nimport numpy as np\nimport argparse\nfrom reader import CityscapeDataset\nimport reader\nimport models\nimport sys\nimport utility\n\nparser = argparse.ArgumentParser()\nadd_arg = lambda *args: utility.add_arguments(*args, argparser=parser)\n\n# yapf: disable\nadd_arg('total_step',           int,    -1,     \"Number of the step to be evaluated, -1 for full evaluation.\")\nadd_arg('init_weights_path',    str,    None,   \"Path of the weights to evaluate.\")\nadd_arg('dataset_path',         str,    None,   \"Cityscape dataset path.\")\nadd_arg('use_gpu',              bool,   True,   \"Whether use GPU or CPU.\")\nadd_arg('num_classes',          int,    19,     \"Number of classes.\")\nadd_arg('use_py_reader',        bool,   True,   \"Use py_reader.\")\nadd_arg('norm_type',            str,    'bn',   \"Normalization type, should be 'bn' or 'gn'.\")\n#yapf: enable\n\n\ndef mean_iou(pred, label):\n    label = fluid.layers.elementwise_min(\n        label, fluid.layers.assign(np.array(\n            [num_classes], dtype=np.int32)))\n    label_ignore = (label == num_classes).astype('int32')\n    label_nignore = (label != num_classes).astype('int32')\n\n    pred = pred * label_nignore + label_ignore * num_classes\n\n    miou, wrong, correct = fluid.layers.mean_iou(pred, label, num_classes + 1)\n    return miou, wrong, correct\n\n\ndef load_model():\n    if os.path.isdir(args.init_weights_path):\n        fluid.io.load_params(\n            exe, dirname=args.init_weights_path, main_program=tp)\n    else:\n        fluid.io.load_params(\n            exe, dirname=\"\", filename=args.init_weights_path, main_program=tp)\n\n\nCityscapeDataset = reader.CityscapeDataset\n\nargs = parser.parse_args()\n\nmodels.clean()\nmodels.is_train = False\nmodels.default_norm_type = args.norm_type\ndeeplabv3p = models.deeplabv3p\n\nimage_shape = [1025, 2049]\neval_shape = [1024, 2048]\n\nsp = fluid.Program()\ntp = fluid.Program()\nbatch_size = 1\nreader.default_config['crop_size'] = -1\nreader.default_config['shuffle'] = False\nnum_classes = args.num_classes\n\nwith fluid.program_guard(tp, sp):\n    if args.use_py_reader:\n        py_reader = fluid.layers.py_reader(capacity=64,\n                                        shapes=[[1, 3, 0, 0], [1] + eval_shape],\n                                        dtypes=['float32', 'int32'])\n        img, label = fluid.layers.read_file(py_reader)\n    else:\n        img = fluid.layers.data(name='img', shape=[3, 0, 0], dtype='float32')\n        label = fluid.layers.data(name='label', shape=eval_shape, dtype='int32')\n\n    img = fluid.layers.resize_bilinear(img, image_shape)\n    logit = deeplabv3p(img)\n    logit = fluid.layers.resize_bilinear(logit, eval_shape)\n    pred = fluid.layers.argmax(logit, axis=1).astype('int32')\n    miou, out_wrong, out_correct = mean_iou(pred, label)\n\ntp = tp.clone(True)\nfluid.memory_optimize(\n    tp,\n    print_log=False,\n    skip_opt_set=set([pred.name, miou, out_wrong, out_correct]),\n    level=1)\n\nplace = fluid.CPUPlace()\nif args.use_gpu:\n    place = fluid.CUDAPlace(0)\nexe = fluid.Executor(place)\nexe.run(sp)\n\nif args.init_weights_path:\n    print(\"load from:\", args.init_weights_path)\n    load_model()\n\ndataset = CityscapeDataset(args.dataset_path, 'val')\nif args.total_step == -1:\n    total_step = len(dataset.label_files)\nelse:\n    total_step = args.total_step\n\nbatches = dataset.get_batch_generator(batch_size, total_step)\nif args.use_py_reader:\n    py_reader.decorate_tensor_provider(lambda :[ (yield b[1],b[2]) for b in batches])\n    py_reader.start()\n\nsum_iou = 0\nall_correct = np.array([0], dtype=np.int64)\nall_wrong = np.array([0], dtype=np.int64)\n\nfor i in range(total_step):\n    if not args.use_py_reader:\n        _, imgs, labels, names = next(batches)\n        result = exe.run(tp,\n                         feed={'img': imgs,\n                               'label': labels},\n                         fetch_list=[pred, miou, out_wrong, out_correct])\n    else:\n        result = exe.run(tp,\n                         fetch_list=[pred, miou, out_wrong, out_correct])\n\n    wrong = result[2][:-1] + all_wrong\n    right = result[3][:-1] + all_correct\n    all_wrong = wrong.copy()\n    all_correct = right.copy()\n    mp = (wrong + right) != 0\n    miou2 = np.mean((right[mp] * 1.0 / (right[mp] + wrong[mp])))\n    print('step: %s, mIoU: %s' % (i + 1, miou2))\n", "path": "PaddleCV/deeplabv3+/eval.py"}], "after_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nif 'FLAGS_fraction_of_gpu_memory_to_use' not in os.environ:\n    os.environ['FLAGS_fraction_of_gpu_memory_to_use'] = '0.98'\nos.environ['FLAGS_enable_parallel_graph'] = '1'\n\nimport paddle\nimport paddle.fluid as fluid\nimport numpy as np\nimport argparse\nfrom reader import CityscapeDataset\nimport reader\nimport models\nimport sys\nimport utility\n\nparser = argparse.ArgumentParser()\nadd_arg = lambda *args: utility.add_arguments(*args, argparser=parser)\n\n# yapf: disable\nadd_arg('total_step',           int,    -1,     \"Number of the step to be evaluated, -1 for full evaluation.\")\nadd_arg('init_weights_path',    str,    None,   \"Path of the weights to evaluate.\")\nadd_arg('dataset_path',         str,    None,   \"Cityscape dataset path.\")\nadd_arg('use_gpu',              bool,   True,   \"Whether use GPU or CPU.\")\nadd_arg('num_classes',          int,    19,     \"Number of classes.\")\nadd_arg('use_py_reader',        bool,   True,   \"Use py_reader.\")\nadd_arg('norm_type',            str,    'bn',   \"Normalization type, should be 'bn' or 'gn'.\")\n#yapf: enable\n\n\ndef mean_iou(pred, label):\n    label = fluid.layers.elementwise_min(\n        label, fluid.layers.assign(np.array(\n            [num_classes], dtype=np.int32)))\n    label_ignore = (label == num_classes).astype('int32')\n    label_nignore = (label != num_classes).astype('int32')\n\n    pred = pred * label_nignore + label_ignore * num_classes\n\n    miou, wrong, correct = fluid.layers.mean_iou(pred, label, num_classes + 1)\n    return miou, wrong, correct\n\n\ndef load_model():\n    if os.path.isdir(args.init_weights_path):\n        fluid.io.load_params(\n            exe, dirname=args.init_weights_path, main_program=tp)\n    else:\n        fluid.io.load_params(\n            exe, dirname=\"\", filename=args.init_weights_path, main_program=tp)\n\n\nCityscapeDataset = reader.CityscapeDataset\n\nargs = parser.parse_args()\n\nmodels.clean()\nmodels.is_train = False\nmodels.default_norm_type = args.norm_type\ndeeplabv3p = models.deeplabv3p\n\nimage_shape = [1025, 2049]\neval_shape = [1024, 2048]\n\nsp = fluid.Program()\ntp = fluid.Program()\nbatch_size = 1\nreader.default_config['crop_size'] = -1\nreader.default_config['shuffle'] = False\nnum_classes = args.num_classes\n\nwith fluid.program_guard(tp, sp):\n    if args.use_py_reader:\n        py_reader = fluid.layers.py_reader(capacity=64,\n                                        shapes=[[1, 3, 0, 0], [1] + eval_shape],\n                                        dtypes=['float32', 'int32'])\n        img, label = fluid.layers.read_file(py_reader)\n    else:\n        img = fluid.layers.data(name='img', shape=[3, 0, 0], dtype='float32')\n        label = fluid.layers.data(name='label', shape=eval_shape, dtype='int32')\n\n    img = fluid.layers.resize_bilinear(img, image_shape)\n    logit = deeplabv3p(img)\n    logit = fluid.layers.resize_bilinear(logit, eval_shape)\n    pred = fluid.layers.argmax(logit, axis=1).astype('int32')\n    miou, out_wrong, out_correct = mean_iou(pred, label)\n\ntp = tp.clone(True)\nfluid.memory_optimize(\n    tp,\n    print_log=False,\n    skip_opt_set=set([pred.name, miou, out_wrong, out_correct]),\n    level=1)\n\nplace = fluid.CPUPlace()\nif args.use_gpu:\n    place = fluid.CUDAPlace(0)\nexe = fluid.Executor(place)\nexe.run(sp)\n\nif args.init_weights_path:\n    print(\"load from:\", args.init_weights_path)\n    load_model()\n\ndataset = CityscapeDataset(args.dataset_path, 'val')\nif args.total_step == -1:\n    total_step = len(dataset.label_files)\nelse:\n    total_step = args.total_step\n\nbatches = dataset.get_batch_generator(batch_size, total_step)\nif args.use_py_reader:\n    py_reader.decorate_tensor_provider(lambda :[ (yield b[0],b[1]) for b in batches])\n    py_reader.start()\n\nsum_iou = 0\nall_correct = np.array([0], dtype=np.int64)\nall_wrong = np.array([0], dtype=np.int64)\n\nfor i in range(total_step):\n    if not args.use_py_reader:\n        _, imgs, labels, names = next(batches)\n        result = exe.run(tp,\n                         feed={'img': imgs,\n                               'label': labels},\n                         fetch_list=[pred, miou, out_wrong, out_correct])\n    else:\n        result = exe.run(tp,\n                         fetch_list=[pred, miou, out_wrong, out_correct])\n\n    wrong = result[2][:-1] + all_wrong\n    right = result[3][:-1] + all_correct\n    all_wrong = wrong.copy()\n    all_correct = right.copy()\n    mp = (wrong + right) != 0\n    miou2 = np.mean((right[mp] * 1.0 / (right[mp] + wrong[mp])))\n    print('step: %s, mIoU: %s' % (i + 1, miou2))\n\nprint('eval done!')\n", "path": "PaddleCV/deeplabv3+/eval.py"}]}