Great work!
I downloaded the sample Tusimple dataset provided in the repo. It has only two folders namely images and groundtruth.
After this, I ran the code using below command
python main.py --image_dir /path/to/image/folder --gt_dir /path/to/ground_truth/folder --end_to_end True
and training process did not start and got the below error:
(ld_env) $ python main.py --image_dir /home/teai/DVA/LaneDetection_End2End/DATASET/images/ --gt_dir /home/teai/DVA/LaneDetection_End2End/DATASET/ground_truth/ --end_to_end False
size train loader is 2901
size valid loader is 725
Flipping images randomly: False
End to end lane detection: False
size test loader: 2782
Init weights in network with [kaiming]
Init model: 'erfnet'
Number of parameters in model ERFNET is 2.064M
=> Start train set for EPOCH 1
Saving to: Saved/Mod_erfnet_opt_adam_loss_area_lr_0.0001_batch_8_end2end_False_chol_False_lanes_2_pretrainFalse_clasFalse_mask0.3_flip_onFalse_activation_square
0it [00:00, ?it/s]Traceback (most recent call last):
File "main.py", line 552, in
main()
File "main.py", line 243, in main
for i, (input, gt, lanes, idx, gt_line, gt_horizon, valid_points) in tqdm(enumerate(train_loader)):
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/tqdm/std.py", line 1102, in iter
for obj in iterable:
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in next
return self._process_data(data)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
data.reraise()
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/_utils.py", line 369, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 82, in default_collate
raise TypeError(default_collate_err_msg_format.format(elem_type))
TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>
0it [00:00, ?it/s]
Do you have any idea on how to recover from this error ? Also do I need entire Tusimple dataset to run this or subset which was specified in repo is enough?
Seems that there are None type objects when Pytorch calls the collate function. Just set a breakpoint in the __getitem__ method and check where they are coming from.
You can either run on the subset or the complete tusimple dataset. You will have to download the complete dataset from tusimple then.
Hi @wvangansbeke ,
Great work! I downloaded the sample Tusimple dataset provided in the repo. It has only two folders namely images and groundtruth. After this, I ran the code using below command python main.py --image_dir /path/to/image/folder --gt_dir /path/to/ground_truth/folder --end_to_end True
and training process did not start and got the below error: (ld_env) $ python main.py --image_dir /home/teai/DVA/LaneDetection_End2End/DATASET/images/ --gt_dir /home/teai/DVA/LaneDetection_End2End/DATASET/ground_truth/ --end_to_end False size train loader is 2901 size valid loader is 725 Flipping images randomly: False End to end lane detection: False size test loader: 2782 Init weights in network with [kaiming]
Args:Namespace(activation_layer='square', activation_net='relu', batch_size=8, channels_in=3, clas=False, clip_grad_norm=0, crop_size=80, cudnn=True, dataset='lane_detection', draw_testset=False, end_to_end=False, evaluate=False, flip_on=False, gamma=0.0, gt_dir='/home/teai/DVA/LaneDetection_End2End/DATASET/ground_truth/', image_dir='/home/teai/DVA/LaneDetection_End2End/DATASET/images/', json_file='Labels/Curve_parameters.json', layers=18, learning_rate=0.0001, list=[954, 2789], loss_policy='area', lr_decay=False, lr_decay_iters=30, lr_policy=None, mask_percentage=0.3, mod='erfnet', nclasses=2, nepochs=500, niter=50, niter_decay=400, no_cuda=False, no_dropout=False, no_mapping=False, no_ortho=False, no_tb=True, norm='batch', num_train=3626, nworkers=8, optimizer='adam', order=2, pool=True, pretrain_epochs=20, pretrained=False, print_freq=500, reg_ls=0, resize=256, resume='', save_freq=100, save_path='Saved/Mod_erfnet_opt_adam_loss_area_lr_0.0001_batch_8_end2end_False_chol_False_lanes_2_pretrainFalse_clasFalse_mask0.3_flip_onFalse_activation_square', skip_epochs=10, split_percentage=0.2, start_epoch=0, test_dir='/usr/data/tmp/Lane_Detection/TESTSET/', test_mode=False, use_cholesky=False, val_batch_size=8, weight_class=1, weight_decay=0, weight_fit=1, weight_funct='none', weight_init='kaiming', weight_seg=30)
Init model: 'erfnet' Number of parameters in model ERFNET is 2.064M
=> Start train set for EPOCH 1 Saving to: Saved/Mod_erfnet_opt_adam_loss_area_lr_0.0001_batch_8_end2end_False_chol_False_lanes_2_pretrainFalse_clasFalse_mask0.3_flip_onFalse_activation_square 0it [00:00, ?it/s]Traceback (most recent call last): File "main.py", line 552, in
main()
File "main.py", line 243, in main
for i, (input, gt, lanes, idx, gt_line, gt_horizon, valid_points) in tqdm(enumerate(train_loader)):
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/tqdm/std.py", line 1102, in iter
for obj in iterable:
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in next
return self._process_data(data)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
data.reraise()
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/_utils.py", line 369, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/teai/DVA/ld_env/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 82, in default_collate
raise TypeError(default_collate_err_msg_format.format(elem_type))
TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>
0it [00:00, ?it/s]
Do you have any idea on how to recover from this error ? Also do I need entire Tusimple dataset to run this or subset which was specified in repo is enough?
Thanks in advance..
Regards Abhi