cfzd / Ultra-Fast-Lane-Detection

Ultra Fast Structure-aware Deep Lane Detection (ECCV 2020)
MIT License
1.83k stars 493 forks source link

Labelling our own data #330

Open KaiTang98 opened 1 year ago

KaiTang98 commented 1 year ago

May I ask for any advice such that

How could we make our own data for training this network?

Thanks a lot.

cfzd commented 1 year ago

@KaiTang98 The most convenient way might be: label your data like CULane, and use the labeled data to train the model as the CULane ways.

KaiTang98 commented 1 year ago

Thank you for your reply cfzd. Before I want to try my labeled data, I first try to use CULane but with setting the num_lanes in culane.py equal to 1 or 2 or 3. However, I found that all this case didn't work with the error:

Exception has occurred: RuntimeError CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. File "C:\Users\kaita\Ultra-Fast-Lane-Detection\utils\dist_utils.py", line 142, in add_scalar super(DistSummaryWriter, self).add_scalar(*args, **kwargs) File "C:\Users\kaita\Ultra-Fast-Lane-Detection\train.py", line 56, in calc_loss logger.add_scalar('loss/'+loss_dict['name'][i], loss_cur, global_step) File "C:\Users\kaita\Ultra-Fast-Lane-Detection\train.py", line 74, in train loss = calc_loss(loss_dict, results, logger, global_step) File "C:\Users\kaita\Ultra-Fast-Lane-Detection\train.py", line 156, in train(net, train_loader, loss_dict, optimizer, scheduler,logger, epoch, metric_dict, cfg.use_aux) RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Could you give me some advice? Many thanks.

cfzd commented 1 year ago

@KaiTang98 The error CUDA error: device-side assert triggered usually means that the number of classess in GT exceeds the number of classes of the network. For example, you have a 5-class classification network, however, the GT contains a class label of 7. This will trigger the error.

KaiTang98 commented 1 year ago

Thank you for your kind reply. You are right, the number of classess in GT should smaller than the number of classes of the network.

Then I decide to create my own label to check if it works in your framework. May I ask why each line of the train_gt.txt is structured like this: img label 1 1 1. I checked the part to load the training data, it seems that this code only reads the image and the label without using the rest of the information (1 1 1 1). Could you give me a hint? Is this information used in other parts, and should I create my custom train_gt.txt file following this layout? Many thanks.

cfzd commented 1 year ago

@KaiTang98 In fact, we get the information of (1 1 1 1) from the segmentation map. This label matches the segmentation label exactly. For example, if a segmentation map has id label of (2,3), then the label would be (0 1 1 0). The code can be found here: https://github.com/cfzd/Ultra-Fast-Lane-Detection/blob/353df107756b8c03c22c27201e33fc63d84ecfe6/data/dataset.py#L119-L130

The lane_idx is what you want.

KaiTang98 commented 1 year ago

Thanks for your reply. Yeah, that's what I am talking about such that the code doesn't use the lane label in train_gt.txt file, but calculates the lane index every time when the trained image is loaded. But anyway, I think I had a better understanding of this amazing method. Thank you so much.

cfzd commented 1 year ago

You are welcome. : )

chelsea456 commented 11 months ago

@KaiTang98 The most convenient way might be: label your data like CULane, and use the labeled data to train the model as the CULane ways.

hi , you can teach me how to label CULane data, what tool to label this, tks you very much

chelsea456 commented 11 months ago

Thanks for your reply. Yeah, that's what I am talking about such that the code doesn't use the lane label in train_gt.txt file, but calculates the lane index every time when the trained image is loaded. But anyway, I think I had a better understanding of this amazing method. Thank you so much.

hi , you can teach me how to label CULane data, what tool to label this, tks you very much