ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

The indicator results printed during training are inconsistent with the results of imported weights

Open Liu-zhi-chao opened this issue 1 year ago • 7 comments

Search before asking

  • [X] I have searched the Ultralytics YOLO issues and found no similar bug report.

Ultralytics YOLO Component

Train, Val

Bug

The indicator results printed during training are inconsistent with the results of imported weights

Hello, the dataset I used is divided into two parts: training set and test set. During the training process, whether it is the val results printed from the terminal or the saved results.png, mAP50 is almost always above 92. But when I finished training and val it by importing the xx.pt weight file, something unexpected happened. The specific description is as follows:

(1) I set epoch=100, patience=20, save_period=10. In the end, a total of 66 epochs were trained.

(2) When I use weight files from different rounds for testing, the mAP50 results are as follows: epoch30.pt(133.Mb)---------> mAP:96.2 epoch40.pt(133.Mb)---------> mAP:84.6 epoch60.pt(133.Mb)---------> mAP:68.9 best.pt (23.Mb)---------> mAP:66.4

But from result.png, we can see that after epoch>6, mAP has been stable at 92+, so what is the problem that causes the val result of the imported weights to be inconsistent with results.png? It is worth noting that not only mAP50, but also other Recall and mAP50-95 indicators are inconsistent. train_final results

Environment

Ultralytics YOLOv8.0.238 🚀 Python-3.10.14 torch-2.3.1+cu118 CPU (AMD EPYC 9754 128-Core Processor) Setup complete ✅ (256 CPUs, 755.2 GB RAM, 16.8/30.0 GB disk)

OS Linux-5.15.0-101-generic-x86_64-with-glibc2.35 Environment Linux Python 3.10.14 Install git RAM 755.16 GB CPU AMD EPYC 9754 128-Core Processor CUDA None

numpy ✅ 1.26.4<2.0.0,>=1.23.5 matplotlib ✅ 3.9.2>=3.3.0 opencv-python ✅ 4.10.0.84>=4.6.0 pillow ✅ 10.4.0>=7.1.2 pyyaml ✅ 6.0.2>=5.3.1 requests ✅ 2.32.3>=2.23.0 scipy ✅ 1.14.1>=1.4.1 torch ✅ 2.3.1+cu118>=1.8.0 torchvision ✅ 0.18.1+cu118>=0.9.0 tqdm ✅ 4.66.5>=4.64.0 psutil ✅ 6.0.0 py-cpuinfo ✅ 9.0.0 pandas ✅ 2.2.2>=1.1.4 seaborn ✅ 0.13.2>=0.11.0 ultralytics-thop ✅ 2.0.5>=2.0.0

Minimal Reproducible Example

None

Additional

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

Liu-zhi-chao avatar Sep 29 '24 01:09 Liu-zhi-chao

👋 Hello @Liu-zhi-chao, thank you for bringing this to our attention 🚀! We understand you're experiencing an issue with training indicators being inconsistent with imported weights.

We suggest checking out our Docs for potential solutions. You can find useful Python and CLI usage examples, which may help troubleshoot the problem.

For this 🐛 Bug Report, please provide a minimum reproducible example so we can better assist in diagnosing the issue.

Don't forget to connect with our lively community! Whether you prefer Discord for chat 🎧, Discourse for in-depth discussions, or our Subreddit for shared learning, you're more than welcome.

Upgrade

Ensure you are using the latest ultralytics package with all requirements in a Python>=3.8 environment with PyTorch>=1.8:

pip install -U ultralytics

Environments

You can run YOLOv8 in various environments (with dependencies like CUDA preinstalled):

Status

Ultralytics CI

This badge indicates that all Ultralytics CI tests are currently passing. CI tests ensure the proper functioning of all YOLOv8 Modes and Tasks across different platforms.

An Ultralytics engineer will also review your issue soon. Thank you for your patience 😊!

UltralyticsAssistant avatar Sep 29 '24 01:09 UltralyticsAssistant

Thank you for your reply. What is the cause of this problem? I am using Linux and cannot use fix.zip. It seems that it is for Windows.

Liu-zhi-chao avatar Sep 29 '24 01:09 Liu-zhi-chao

That is a really old ultralytics version. Upgrade it. pip install -U ultralytics

Y-T-G avatar Sep 29 '24 06:09 Y-T-G

@Liu-zhi-chao the mega link above is a virus. Its a spam attack that has been going around

Skillnoob avatar Sep 29 '24 10:09 Skillnoob

@Skillnoob please delete these virus comments if you can

glenn-jocher avatar Sep 30 '24 14:09 glenn-jocher

@Liu-zhi-chao added an 'invalid' tag as this is not reproducible in the latest ultralytics 8.3.0 version. Upgrade as mentioned above and everything should be solved.

glenn-jocher avatar Sep 30 '24 14:09 glenn-jocher

@glenn-jocher I (and toxite/Y-T-G) don't have permission to delete comments or modify them. Would be great if we could receive them.

Skillnoob avatar Sep 30 '24 14:09 Skillnoob

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

  • Docs: https://docs.ultralytics.com
  • HUB: https://hub.ultralytics.com
  • Community: https://community.ultralytics.com

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

github-actions[bot] avatar Dec 08 '24 00:12 github-actions[bot]