From c061d6d30ed650026520821936b8e5de81851843 Mon Sep 17 00:00:00 2001 From: MengzhangLI Date: Thu, 9 Jun 2022 11:01:56 +0800 Subject: [PATCH] [Fix] Fix omitting to_tensor in PackSegInputs --- mmseg/datasets/pipelines/formatting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmseg/datasets/pipelines/formatting.py b/mmseg/datasets/pipelines/formatting.py index bbc04ba74..9c390022a 100644 --- a/mmseg/datasets/pipelines/formatting.py +++ b/mmseg/datasets/pipelines/formatting.py @@ -69,7 +69,8 @@ class PackSegInputs(BaseTransform): data_sample = SegDataSample() if 'gt_seg_map' in results: gt_sem_seg_data = dict( - data=results['gt_seg_map'][None, ...].astype(np.int64)) + data=to_tensor(results['gt_seg_map'][None, + ...].astype(np.int64))) data_sample.gt_sem_seg = PixelData(**gt_sem_seg_data) img_meta = {}