VCIP-RGBD / DFormer

[ICLR 2024] DFormer: Rethinking RGBD Representation Learning for Semantic Segmentation
https://yinbow.github.io/Projects/DFormer/index.html
MIT License
152 stars 24 forks source link

Inference for SUN RGB-D dataset #19

Closed JunghoYoo closed 6 months ago

JunghoYoo commented 6 months ago

When I executed 'inver.sh', I got failed message from evaluate_msf function in 'val_mm.py'. It seems that inference with SUN RGB-D dataset was not implemented. (line number 385). Is there any reason ?

caojiaolong commented 6 months ago

Thanks for your reminder!

We have updated the code for inference on SUB RGB-D dataset on utils/val_mm.py . You can update the val_mm.py and try it again.

JunghoYoo commented 6 months ago

Thank you!

CK-Sung commented 6 months ago

Thanks for your reminder!

We have updated the code for inference on SUB RGB-D dataset on utils/val_mm.py . You can update the val_mm.py and try it again.

Have you tested training on SUNRGBD dataset?

I got an erorr as below. (evaluate_msf).

File "/ws/utils/train.py", line 403, in all_metrics = evaluate_msf( File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/ws/utils/val_mm.py", line 272, in evaluate_msf for idx, minibatch in enumerate(dataloader): File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in next data = self._next_data() File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data return self._process_data(data) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/opt/conda/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise raise exception RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 265, in default_collate return collate(batch, collate_fn_map=default_collate_fn_map) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 127, in collate return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 127, in return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 119, in collate return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 162, in collate_tensor_fn return torch.stack(batch, 0, out=out) RuntimeError: stack expects each tensor to be equal size, but got [3, 441, 591] at entry 0 and [3, 427, 561] at entry 1

caojiaolong commented 6 months ago

Thanks for your reminder! We have updated the code for inference on SUB RGB-D dataset on utils/val_mm.py . You can update the val_mm.py and try it again.

Have you tested training on SUNRGBD dataset?

I got an erorr as below. (evaluate_msf).

File "/ws/utils/train.py", line 403, in all_metrics = evaluate_msf( File "/opt/conda/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "/ws/utils/val_mm.py", line 272, in evaluate_msf for idx, minibatch in enumerate(dataloader): File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in next** data = self._next_data() File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data return self._process_data(data) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/opt/conda/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise raise exception RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 265, in default_collate return collate(batch, collate_fn_map=default_collate_fn_map) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 127, in collate return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 127, in return elem_type({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem}) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 119, in collate return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map) File "/opt/conda/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 162, in collate_tensor_fn return torch.stack(batch, 0, out=out) RuntimeError: stack expects each tensor to be equal size, but got [3, 441, 591] at entry 0 and [3, 427, 561] at entry 1

Thanks for your reminder!

This problem is caused by the batch size on SUNRGBD dataset, because the images' size in SUNRGBD is different but the same size is required when constructing a minibatch.

We have updated the code for eval on SUNRGBD dataset. You can update the eval.py and train.py and try it again.