SpadeLiu / Lac-GwcNet

Local Similarity Pattern and Cost Self-Reassembling for Deep Stereo Matching Networks
MIT License
44 stars 9 forks source link

Dataloading error #6

Closed Salvatore-tech closed 2 years ago

Salvatore-tech commented 2 years ago

Hi, i'm trying to train the network on KITTI2015 dataset available at the following link https://s3.eu-central-1.amazonaws.com/avg-kitti/data_scene_flow.zip but i'm getting an error while loading the images.

I'm attaching the log below, can you clarify if the dataset structure should be changed? Thanks in advance

File "train.py", line 40, in all_limg, all_rimg, all_ldisp, test_limg, test_rimg, test_ldisp = sf.sf_loader(args.data_path) File "/home/s.starace/Lac-GwcNet-main/dataloader/sceneflow_loader.py", line 32, in sf_loader monkaa_img = filepath + [x for x in image if 'monkaa' in x][0] IndexError: list index out of range

SpadeLiu commented 2 years ago

Hi,

If you want to train a model on KITTI, you should "KITTI_ft.py", but normally, we first train a model on SceneFlow and then finetune it on KITTI due to the limited number of images.

Salvatore-tech commented 2 years ago

Alright it makes sense, so now when i launch python KITTI_ft.py --data_path /home/s.starace/Dataset/KITTI_2015/training --load_path ./preTrained/SceneFlow.pth
i'm getting the following error at the end of epoch 1

Epoch 1 average training loss = 8.483

0%| | 0/40 [00:00<?, ?it/s] 0%| | 0/40 [00:00<?, ?it/s] Traceback (most recent call last): File "KITTI_ft.py", line 173, in main() File "KITTI_ft.py", line 152, in main test_loss = test(imgL, imgR, disp_L) File "KITTI_ft.py", line 112, in test pred_disp = model(imgL, imgR) File "/home/s.starace/Lac-GwcNet-main/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, kwargs) File "/home/s.starace/Lac-GwcNet-main/venv/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 166, in forward return self.module(*inputs[0], *kwargs[0]) File "/home/s.starace/Lac-GwcNet-main/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(input, kwargs) TypeError: forward() missing 1 required positional argument: 'gt_left'

Can you provide any suggestion pls?

SpadeLiu commented 2 years ago

mgR, disp_L)

Hi,

Sorry for the error. In Line 114, we need to put the disparity ground truth into the model as one of the inputs. So please change the code as "pred_disp = model(imgL, imgR, disp_true)". I will fix the error later.

Salvatore-tech commented 2 years ago

Thanks for the answer :+1: the issue no longer persist after 2d432ad14549edd8934890df7352badd20194607