zkyseu / O2SFormer

End-to-End Lane detection with One to Several Transformer
Apache License 2.0
35 stars 9 forks source link

val结果异常 #18

Closed GreatZeZuo closed 1 year ago

GreatZeZuo commented 1 year ago

你好我想问一下为什么训练损失在减小,但是val得到的结果都是0,数据集是官方下载的。是代码的问题还是数据集的原因

` mmdet - INFO - Epoch [2][5500/5555] lr: 2.441e-04, e: 12:25:02, time: 0.432, data_time: 0.008, memory: 6165, cls_loss: 2.7195, reg_xl_loss: 1.6548, iou_loss: 1.3681, seg_loss: 0.0841, loss: 5.8266, grad_norm: 15.30 mmdet - INFO - Epoch [2][5550/5555] lr: 2.439e-04, e: 12:23:39, time: 0.460, data_time: 0.008, memory: 6165, cls_loss: 2.6430, reg_xl_loss: 1.5895, iou_loss: 1.3049, seg_loss: 0.0797, loss: 5.6171, grad_norm: 15.98 2023-10-18 00:10:42,642 - mmdet - INFO - Saving checkpoint at 2 epochs [>>>>>>>>>>>>>>>>>>>>>>>>>>] 34680/34680, 42.4 task/s, elapsed: 818s, ETA: 0023-10-18 00:24:21,965 - mmcv - INFO - Generating evaluation results 2023-10-18 00:24:33,062 - mmcv - INFO - cate:list/test_split/test0_normal.txt 2023-10-18 00:24:33,063 - mmcv - INFO - result is :{0.5: {'TP': 0, 'FP': 0, 'FN'32777, 'Precision': 0, 'Recall': 0, 'F1': 0}}

mmcv - INFO - F1 score is 0 2023-10-18 01:22:19,591 - mmdet - INFO - Exp name: resnet_34_culane.py 2023-10-18 01:22:19,591 - mmdet - INFO - Epoch(val) [3][34680] mAP: 0 `

zkyseu commented 1 year ago

我提供给您log,您对照查看一下,一般来说是没有问题的,resnet50的日志如下: log

zkyseu commented 1 year ago

另外,resnet18和resnet34可能会出现前几轮准确率为0的情况,这是正常的,我训练时候也遇到了。但是renset50是一开始就有准确率,您也可以试一下renset50的。

zkyseu commented 1 year ago

另外,我提供的权重,你验证一下,看看是数据集问题还是代码某些地方没有设置正确。有问题可以随时沟通哈

GreatZeZuo commented 1 year ago

另外,我提供的权重,你验证一下,看看是数据集问题还是代码某些地方没有设置正确。有问题可以随时沟通哈

感谢回复,但是我测试了resnet50也没有准确率,是不是数据集没有shuffle的原因?

zkyseu commented 1 year ago

@GreatZeZuo 建议您可以试一下我提供的预训练权重,来测试一下数据集是否有问题,然后再来查看代码,另外,您可以等到第5个epoch左右来看一下准确率如何

zkyseu commented 1 year ago

首页里面的weight就是哈

GreatZeZuo commented 1 year ago

UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' Traceback (most recent call last): File "test.py", line 20, in <module> from .dnlane.apis import multi_gpu_test,single_gpu_test ImportError: attempted relative import with no known parent package 请问为什么会这样?

zkyseu commented 1 year ago

可以这样修改一下 from dnlane.apis import multi_gpu_test,single_gpu_test而不是from .dnlane.apis import multi_gpu_test,single_gpu_test