xingyuuchen / tri-depth

[WACV 2023] Self-Supervised Monocular Depth Estimation: Solving the Edge-Fattening Problem
GNU General Public License v3.0
77 stars 6 forks source link

KeyError:('seg', 0, 0) #3

Closed Hyyzhangrui closed 1 year ago

Hyyzhangrui commented 1 year ago

Hello, thank you very much for your contribution. I get the following error when adding triplet loss to another network: Traceback (most recent call last): File "train.py", line 17, in trainer.train() File "/root/autodl-tmp/DIFFNet/trainer.py", line 179, in train self.run_epoch() File "/root/autodl-tmp/DIFFNet/trainer.py", line 195, in run_epoch outputs, losses = self.process_batch(inputs) File "/root/autodl-tmp/DIFFNet/trainer.py", line 253, in process_batch losses = self.compute_losses(inputs, outputs) File "/root/autodl-tmp/DIFFNet/trainer.py", line 508, in compute_losses sgt_loss = self.compute_sgt_loss(inputs, outputs) File "/root/autodl-tmp/DIFFNet/trainer.py", line 516, in compute_sgt_loss seg_target = inputs[('seg', 0, 0)] KeyError: ('seg', 0, 0) There is no ('seg',0,0) key in inputs.How to solve such a problem? Looking forward to your response.

xingyuuchen commented 1 year ago

Hello @Hyyzhangrui ,

Thanks for your interest! It seems that you forget to modify the file kitti_dataset.py and mono_dataset.py to load the segmentation images? Here is the line we load the segmentations.

Best, Xingyu

Hyyzhangrui commented 1 year ago

Hello @Hyyzhangrui ,

Thanks for your interest! It seems that you forget to modify the file kitti_dataset.py and mono_dataset.py to load the segmentation images? Here is the line we load the segmentations.

Best, Xingyu

Thank you for recovering my issue so quickly. Yes, as you said, adding semantic images to it solves the problem.

Good luck in your work!🙂

xingyuuchen commented 1 year ago

I'm closing this issue. Feel free to re-open it if needed.