PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.61k stars 2.86k forks source link

[Other General Issues]训练过程中的问题 #4602

Open lixiangMindSpore opened 2 years ago

lixiangMindSpore commented 2 years ago

PaddleDetection team appreciate any suggestion or problem you delivered~

Checklist:

  1. 查找历史相关issue寻求解答/I have searched related issues but cannot get the expected help.
  2. 翻阅FAQ /I have read the FAQ documentation but cannot get the expected help.

描述问题/Describe the bug

A clear and concise description of what the bug is. 下图中1992*batchsize与我训练集的图片数量相差较大,是什么原因? image

复现/Reproduction

  1. 您使用的命令是?/What command or script did you run?
请填写命令/A placeholder for the command.
  1. 您是否更改过代码或配置文件?您是否理解您所更改的内容?还请您提供所更改的部分代码。/Did you make any modifications on the code or config? Did you understand what you have modified? Please provide the codes that you modified.

  2. 您使用的数据集是?/What dataset did you use?

  3. 请提供您出现的报错信息及相关log。/Please provide the error messages or relevant log information.

环境/Environment

  1. 请提供您使用的Paddle和PaddleDetection的版本号/Please provide the version of Paddle and PaddleDetection you use:

  2. 如您在使用PaddleDetection的同时还在使用其他产品,如PaddleServing、PaddleInference等,请您提供其版本号/ Please provide the version of any other related tools/products used, such as the version of PaddleServing and etc:

  3. 请提供您使用的操作系统信息,如Linux/Windows/MacOS /Please provide the OS information, e.g., Linux:

  4. 请问您使用的Python版本是?/ Please provide the version of Python you used.

  5. 请问您使用的CUDA/cuDNN的版本号是?/ Please provide the version of CUDA/cuDNN you used.

如果您的issue是关于安装或环境,您可以先查询安装文档尝试解决~

If your issue looks like an installation issue / environment issue, please first try to solve it yourself with the instructions in https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL.md

ghostxsl commented 2 years ago

默认drop_last为True,应该不会差很多,你差了多少?

lixiangMindSpore commented 2 years ago

默认drop_last为True,应该不会差很多,你差了多少?

image 实际训练集有188297张图片,batchsize设置为1时,仅仅显示 Epoch: [0] [1640/119551]。

ghostxsl commented 2 years ago

默认drop_last为True,应该不会差很多,你差了多少?

image 实际训练集有188297张图片,batchsize设置为1时,仅仅显示 Epoch: [0] [1640/119551]。

你的数据集里应该是含有纯阴性样本的,你可以设置allow_empyt为True来加入这些样本,参考: https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/ppdet/data/source/coco.py#L38

lixiangMindSpore commented 2 years ago

默认drop_last为True,应该不会差很多,你差了多少?

image 实际训练集有188297张图片,batchsize设置为1时,仅仅显示 Epoch: [0] [1640/119551]。

你的数据集里应该是含有纯阴性样本的,你可以设置allow_empyt为True来加入这些样本,参考: https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/ppdet/data/source/coco.py#L38

您好,如果没有加入纯阴性样本,在mAP等指标上会有什么影响?

ghostxsl commented 2 years ago

亲,你的这个问题是好问题,但我很难回答,因为这可能因数据集而异,尽量保证训练集和测试集同分布吧~

lixiangMindSpore commented 2 years ago

亲,你的这个问题是好问题,但我很难回答,因为这可能因数据集而异,尽量保证训练集和测试集同分布吧~

您好,你们当初设置allow_empty为False是出于什么原因?是不是考虑什么因素?

ghostxsl commented 2 years ago

亲,你的这个问题是好问题,但我很难回答,因为这可能因数据集而异,尽量保证训练集和测试集同分布吧~

您好,你们当初设置allow_empty为False是出于什么原因?是不是考虑什么因素?

因为我们一直是在coco数据集上做的实验,在coco上设置allow_empty为True,mAP会下降0.1左右。

lixiangMindSpore commented 2 years ago

亲,你的这个问题是好问题,但我很难回答,因为这可能因数据集而异,尽量保证训练集和测试集同分布吧~

您好,你们当初设置allow_empty为False是出于什么原因?是不是考虑什么因素?

因为我们一直是在coco数据集上做的实验,在coco上设置allow_empty为True,mAP会下降0.1左右。

那我先默认False看一下结果,感谢

lixiangMindSpore commented 2 years ago

亲,你的这个问题是好问题,但我很难回答,因为这可能因数据集而异,尽量保证训练集和测试集同分布吧~

您好,你们当初设置allow_empty为False是出于什么原因?是不是考虑什么因素?

因为我们一直是在coco数据集上做的实验,在coco上设置allow_empty为True,mAP会下降0.1左右。

如果没有空样本,你们验证的时候会不会出现误检?比如我训练识别手机的模型,去掉空样本之后,不管图片里有没有手机,都会圈出一个手机来。

ghostxsl commented 2 years ago

这个在业务场景下很常见,我在做业务场景的时候也会加入纯阴性样本。但coco数据集可能跟业务数据集的分布不太一样,你可以验证一下试试~

lixiangMindSpore commented 2 years ago

默认drop_last为True,应该不会差很多,你差了多少?

image 实际训练集有188297张图片,batchsize设置为1时,仅仅显示 Epoch: [0] [1640/119551]。

你的数据集里应该是含有纯阴性样本的,你可以设置allow_empyt为True来加入这些样本,参考: https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/ppdet/data/source/coco.py#L38

您好,我修改了coco.py的allow_empty为True,但是还是有一点差别,我的batchsize=60,60*3138=188280,但是我的训练集样本总数是188297,少了17个样本,是不是3138应该为3139? image image image

ghostxsl commented 2 years ago

drop_last为丢掉最后一个不满的batch

lixiangMindSpore commented 2 years ago

drop_last为丢掉最后一个不满的batch

如果把drop_last设置为False,会有什么影响?