sel118 / LaneAF

189 stars 36 forks source link

Training error #3

Closed Haithienbao closed 3 years ago

Haithienbao commented 3 years ago

When i try to train, i get error like this: image

I run this code in google colab, and i use torch-1.7.0+cu101 torchvision-0.8.1+cu101, cuda 10.1. Could you help me solve this problem ? thank you!

Haithienbao commented 3 years ago

Epoch: 1 [2/88880 (0%)] Loss: 3.322423 F1-score: 0.0000 Traceback (most recent call last): File "/content/LaneAF/train_culane.py", line 277, in model, avg_loss_seg, avg_loss_vaf, avg_loss_haf, avg_loss, avg_acc, avg_f1 = train(model, i) File "/content/LaneAF/train_culane.py", line 77, in train for b_idx, sample in enumerate(train_loader): File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1065, in _next_data return self._process_data(data) File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1111, in _process_data data.reraise() File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 1. Original Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/content/LaneAF/datasets/culane.py", line 128, in getitem seg = np.tile(seg[..., np.newaxis], (1, 1, 3)) # (H, W, 3) TypeError: 'NoneType' object is not subscriptable

arangesh commented 3 years ago

Can you confirm that you have all the folders in the CULane dataset organized as described in the README? In particular, make sure the CULane/laneseg_label_w16/ and CULane/laneseg_label_w16_test/ folders exist.

Haithienbao commented 3 years ago

@arangesh Thank you for your help. I downloaded all folders as described in the README. I show it in the photo below

image

and now I still facing on this error image

Could you give me some advice ? Thank you very much

qinjian623 commented 3 years ago

Check this line: https://github.com/sel118/LaneAF/blob/6f020686166660d63e4abf939901394c75bf12db/datasets/culane.py#L117

Maybe you should remove the [1:] part. And don't forget doing this to seg (3 lines below) too.

Haithienbao commented 3 years ago

Can you confirm that you have all the folders in the CULane dataset organized as described in the README? In particular, make sure the CULane/laneseg_label_w16/ and CULane/laneseg_label_w16_test/ folders exist.

Thank you so much. I solved my problem