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

When generating results.png, bug happened with disorder on Y-axis of val/box_loss, val/obj_loss and val/cls_loss #7650

Closed
1 of 2 tasks
sylvanding opened this issue Apr 30, 2022 · 4 comments · Fixed by #7654
Labels
bug Something isn't working

Comments

@sylvanding
Copy link
Contributor

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Training

Bug

When I set the batch size to 16 and tried to generate results.png by calling plot_results() in plots.py, something wrong happened. As the image shows below, there are disorders on the Y-axis of val/box_loss, val/obj_loss and val/cls_loss. And matplotlib output the following warning:

Using categorical units to plot a list of strings that are all parsable as floats or dates. If these strings should be plotted as numbers, cast to the appropriate data type before plotting.

However, when I set batch size to 8 and 4, the problem disappeared.
Then I added a line of code after y = data.values[:, j] in plot_results() like this:

for i, j in enumerate([1, 2, 3, 4, 5, 8, 9, 10, 6, 7]):
  y = data.values[:, j]
  y = y.astype('float') # added code

the problem was solved.
A07i7.png

Environment

the latest version cloned from GitHub

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@sylvanding sylvanding added the bug Something isn't working label Apr 30, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 30, 2022

👋 Hello @sylvanding, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 30, 2022

@sylvanding hi, thank you for your feature suggestion on how to improve YOLOv5 🚀!

The fastest and easiest way to incorporate your ideas into the official codebase is to submit a Pull Request (PR) implementing your idea, and if applicable providing before and after profiling/inference/training results to help us understand the improvement your feature provides. This allows us to directly see the changes in the code and to understand how they affect workflows and performance.

Please see our ✅ Contributing Guide to get started.

@glenn-jocher glenn-jocher linked a pull request May 1, 2022 that will close this issue
glenn-jocher pushed a commit that referenced this issue May 1, 2022
fix bug in issue #7650
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this issue Jun 10, 2022
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this issue Aug 26, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this issue Sep 8, 2022
@12moli
Copy link

12moli commented Nov 2, 2022

Hello, I added the above code but the problem is still not solved. I am using yolov5 where the backbone part has been modified by me and the result is as follows.Snipaste_2022-11-02_19-55-31
But if I use the original yolov5 weights and network structure, there is no problem at all.What should I do to solve the problem that appears in the picture?

@glenn-jocher
Copy link
Member

Hi @12moli, thanks for the update. It's great that you have narrowed down the issue to your modified backbone. The problem you are experiencing seems to be related to the modifications you made. To further investigate and solve the problem, I recommend carefully reviewing the changes you made to the backbone and comparing them with the original YOLOv5 implementation. This will help identify any discrepancies that might be causing the issue.

You may also want to verify that the data inputs and outputs in the modified backbone are consistent with the original YOLOv5 implementation. Ensuring compatibility with the rest of the YOLOv5 architecture is crucial for proper functioning.

Let me know if you need any further assistance in resolving this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants