cfzd / Ultra-Fast-Lane-Detection

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

我在运行train.py时出现了以下报错 #356

Open ZzhhzZ12345679 opened 11 months ago

ZzhhzZ12345679 commented 11 months ago

我在运行train.py时出现了以下报错: Traceback (most recent call last): File "train.py", line 152, in train(net, train_loader, loss_dict, optimizer, scheduler,logger, epoch, metric_dict, cfg.use_aux) File "train.py", line 68, in train loss = calc_loss(loss_dict, results, logger, global_step) File "train.py", line 47, in calc_loss loss_cur = loss_dict['op']i File "D:\anaconda\envs\lane\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "D:\anaconda\envs\lane\lib\site-packages\torch\nn\modules\loss.py", line 1176, in forward label_smoothing=self.label_smoothing) File "D:\anaconda\envs\lane\lib\site-packages\torch\nn\functional.py", line 3026, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of size: : [32, 36, 100, 3]

xings-sdnu commented 10 months ago

chane the use_aux to False can work: parser.add_argument('--use_aux', default='False', type=str2bool)

lz06787 commented 8 months ago

我也遇到了这个问题,应该是因为CULane的seg label是个1通道的png,我的数据集的seg label是个3通道的,调整一下label维度就好了

ZzhhzZ12345679 commented 4 months ago

怎么调整这个维度