Skip to content

Commit 85b6489

Browse files
merofeevYknZhu
authored andcommitted
Fix DeepLab Python 3 compatibility issue #6797. (#6799)
1 parent 0b09300 commit 85b6489

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

research/deeplab/eval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def main(unused_argv):
8888
split_name=FLAGS.eval_split,
8989
dataset_dir=FLAGS.dataset_dir,
9090
batch_size=FLAGS.eval_batch_size,
91-
crop_size=map(int, FLAGS.eval_crop_size),
91+
crop_size=[int(sz) for sz in FLAGS.eval_crop_size],
9292
min_resize_value=FLAGS.min_resize_value,
9393
max_resize_value=FLAGS.max_resize_value,
9494
resize_factor=FLAGS.resize_factor,
@@ -106,7 +106,7 @@ def main(unused_argv):
106106

107107
model_options = common.ModelOptions(
108108
outputs_to_num_classes={common.OUTPUT_TYPE: dataset.num_of_classes},
109-
crop_size=map(int, FLAGS.eval_crop_size),
109+
crop_size=[int(sz) for sz in FLAGS.eval_crop_size],
110110
atrous_rates=FLAGS.atrous_rates,
111111
output_stride=FLAGS.output_stride)
112112

research/deeplab/train.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def _build_deeplab(iterator, outputs_to_num_classes, ignore_label):
213213

214214
model_options = common.ModelOptions(
215215
outputs_to_num_classes=outputs_to_num_classes,
216-
crop_size=map(int, FLAGS.train_crop_size),
216+
crop_size=[int(sz) for sz in FLAGS.train_crop_size],
217217
atrous_rates=FLAGS.atrous_rates,
218218
output_stride=FLAGS.output_stride)
219219

@@ -446,7 +446,7 @@ def main(unused_argv):
446446
split_name=FLAGS.train_split,
447447
dataset_dir=FLAGS.dataset_dir,
448448
batch_size=clone_batch_size,
449-
crop_size=map(int, FLAGS.train_crop_size),
449+
crop_size=[int(sz) for sz in FLAGS.train_crop_size],
450450
min_resize_value=FLAGS.min_resize_value,
451451
max_resize_value=FLAGS.max_resize_value,
452452
resize_factor=FLAGS.resize_factor,

research/deeplab/vis.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def main(unused_argv):
193193
split_name=FLAGS.vis_split,
194194
dataset_dir=FLAGS.dataset_dir,
195195
batch_size=FLAGS.vis_batch_size,
196-
crop_size=map(int, FLAGS.vis_crop_size),
196+
crop_size=[int(sz) for sz in FLAGS.vis_crop_size],
197197
min_resize_value=FLAGS.min_resize_value,
198198
max_resize_value=FLAGS.max_resize_value,
199199
resize_factor=FLAGS.resize_factor,
@@ -222,7 +222,7 @@ def main(unused_argv):
222222

223223
model_options = common.ModelOptions(
224224
outputs_to_num_classes={common.OUTPUT_TYPE: dataset.num_of_classes},
225-
crop_size=map(int, FLAGS.vis_crop_size),
225+
crop_size=[int(sz) for sz in FLAGS.vis_crop_size],
226226
atrous_rates=FLAGS.atrous_rates,
227227
output_stride=FLAGS.output_stride)
228228

0 commit comments

Comments
 (0)