Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the mAP(0.06) so low? Same dataset, same batch-size, when trained with ultralytics/yolov5, mAP is 0.90 within less than 200 epochs. #16

Closed
ShirleyHe2020 opened this issue Apr 18, 2021 · 16 comments

Comments

@ShirleyHe2020
Copy link

image

@ShirleyHe2020
Copy link
Author

Don't know if anything I need to be notified of before training with code in this repo....

@Bobo-y
Copy link
Owner

Bobo-y commented Apr 20, 2021

@ShirleyHe2020 can you tell me which backbone ? I will verify it.

@Zpadger
Copy link

Zpadger commented Apr 23, 2021

@yl305237731 I also encountered the same problem, using EfficientNet:
python ./scripts/train.py --img 640 --batch 4 --epoch 10 --data ./data/color_class.yaml --cfg ./configs/model_efficientnet.yaml

@Bobo-y
Copy link
Owner

Bobo-y commented Apr 23, 2021

@yl305237731 I also encountered the same problem, using EfficientNet:
python ./scripts/train.py --img 640 --batch 4 --epoch 10 --data ./data/color_class.yaml --cfg ./configs/model_efficientnet.yaml

@Zpadger 😳,OK ,i will try this backbone.

@Zpadger
Copy link

Zpadger commented Apr 23, 2021

@yl305237731 I just located the problem, and it seems I know the reason, I forgot to change the classes in the model_efficient.yaml file,so the "nc" is still "nc : 1".I have corrected the value now, and I am going to continue to run the experiment and wait for tomorrow to verify the result.

@Bobo-y
Copy link
Owner

Bobo-y commented Apr 23, 2021

@Zpadger i have try efficientnet B2 as backbone, it's no problem.

@Bobo-y
Copy link
Owner

Bobo-y commented Apr 23, 2021

Don't know if anything I need to be notified of before training with code in this repo....

@ShirleyHe2020 hi, may be your problem is same as @Zpadger , so check nc in model_XXXX.yaml.

@Zpadger
Copy link

Zpadger commented Apr 24, 2021

@yl305237731 I got up in the morning and looked at the training results. There is no problem with the EfficientNet model. At present, the mAP of Epoch35/49 has reached 0.982. Thank you for your contribution.

@Bobo-y Bobo-y closed this as completed Apr 24, 2021
@ShirleyHe2020
Copy link
Author

@ShirleyHe2020 can you tell me which backbone ? I will verify it


from my side, all the backbones ( mobilenet, efficientnet, reset ) suffer the same issue.

@Bobo-y
Copy link
Owner

Bobo-y commented Apr 28, 2021

@ShirleyHe2020 i think you forget to change the nc to your dataset in model_xxx.yaml

@ShirleyHe2020
Copy link
Author

Don't know if anything I need to be notified of before training with code in this repo....

@ShirleyHe2020 hi, may be your problem is same as @Zpadger , so check nc in model_XXXX.yaml.

thanks @Zpadger , same issue , 'nc' changed then mAP reached expected level

@Lg955
Copy link

Lg955 commented Apr 30, 2021

Hi @ShirleyHe2020 @Zpadger Where to load the efficientnet weights when using the B6 as backbone? It does not remind me to download weights or load it.

@Bobo-y
Copy link
Owner

Bobo-y commented May 1, 2021

@Lg955 hi, i have try b6, there is no problem
image

add pretrained: True in model_efficientnet.yaml under backbone

@Lg955
Copy link

Lg955 commented May 1, 2021

@yl305237731 My showing of result is different from yours: (the error in the bottom of img is out of cuda memory, ignore it)
loader

And the .yaml is this:
backbone: type: efficientnet version: b2 # b1 to b8 and l2 head: nc: 5 stride: [8.0, 16.0, 32.0] anchors: - [10,13, 16,30, 33,23] # P3/8 - [30,61, 62,45, 59,119] # P4/16 - [116,90, 156,198, 373,326] # P5/32

@Bobo-y
Copy link
Owner

Bobo-y commented May 1, 2021

@Lg955 for above information, I can't see the problem. and i test b2, there is no problem

@Lg955
Copy link

Lg955 commented May 6, 2021

Hi, @yl305237731 when detect imgs, the pred result is empty after NMS(pred result is OK before NMS), have you encountered the same problem?

`pred before NMS tensor([[[7.02863e+00, 4.92409e+00, 2.66565e+01, ..., 3.92634e-02, 1.15775e-01, 2.56261e-03],
[1.08675e+01, 4.00093e+00, 3.37639e+01, ..., 4.27754e-02, 8.12325e-02, 4.94392e-03],
[1.85410e+01, 3.28052e+00, 3.73997e+01, ..., 5.11962e-02, 1.00191e-01, 5.55359e-03],
...,
[1.20430e+03, 7.04980e+02, 2.17258e+02, ..., 3.21729e-02, 2.10942e-01, 8.92933e-02],
[1.22968e+03, 7.08009e+02, 2.33180e+02, ..., 4.42553e-02, 2.42864e-01, 1.20849e-01],
[1.25142e+03, 7.13127e+02, 1.60746e+02, ..., 3.88758e-02, 1.66492e-01, 1.16945e-01]]], device='cuda:0')

/------------------------/

pred after NMS [tensor([], device='cuda:0', size=(0, 6))]`

@Bobo-y Bobo-y mentioned this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants