Giter VIP home page Giter VIP logo

Comments (4)

github-actions avatar github-actions commented on June 24, 2024

πŸ‘‹ Hello @Himmelsw4nderer, thank you for your interest in Ultralytics YOLOv8 πŸš€! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a πŸ› Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

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

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on June 24, 2024

@Himmelsw4nderer hi there,

Thank you for providing a detailed description of the issue and the relevant code snippets. Let's work through this step by step to understand and resolve the problem you're encountering with the validation of your classification model.

Initial Checks

  1. Reproducibility: To ensure we can reproduce the issue, could you please confirm that the provided code snippets are complete and can be run as-is? If there are any additional dependencies or configurations required, please include those details.

  2. Package Versions: Ensure you are using the latest versions of torch and ultralytics. You can update them using:

    pip install --upgrade torch ultralytics

Analysis

From your description, it seems like there are inconsistencies between the training and validation results, particularly with the confusion matrix. Here are a few points to consider:

  1. Training and Validation Data: Ensure that the training and validation datasets are correctly split and that there is no data leakage between them. This can significantly affect the model's performance.

  2. Background Class: You mentioned removing the background class improved the results. This suggests that the background class might be causing confusion during training. Ensure that the background class is correctly labeled and that the model is appropriately configured to handle it.

  3. Custom Validation Script: Your custom validation script seems to be working correctly, but the discrepancy between the training and validation confusion matrices suggests there might be an issue with how the data is being processed or evaluated.

Suggested Steps

  1. Verify Data Splits: Double-check your data splits to ensure there is no overlap between training and validation datasets.

  2. Model Configuration: Ensure that the model configuration is consistent between training and validation. This includes image preprocessing steps, class labels, and any augmentation techniques used.

  3. Use Built-in Validation: To isolate the issue, try using the built-in validation method provided by Ultralytics without any custom scripts. This can help determine if the issue lies within the custom validation logic.

Example Code for Built-in Validation

Here’s an example of how to use the built-in validation method:

from ultralytics import YOLO

# Load your trained model
model = YOLO('runs/classify/train33/weights/best.pt')

# Validate the model on the validation dataset
results = model.val(data='datasets/fold_4/val')
print(results)

Additional Resources

For more detailed information on validation, you can refer to the Ultralytics documentation on model validation.

If the issue persists after these checks, please provide any additional logs or error messages that might help in diagnosing the problem further.

Feel free to reach out with any more questions or updates on your progress. We're here to help! 😊

from ultralytics.

Himmelsw4nderer avatar Himmelsw4nderer commented on June 24, 2024

Hi,
there were some issues in the formatting of markup, so the code was incomplete at the top.

I was already on the newest versions of ultralytics and torch

Using:

from ultralytics import YOLO

# Load your trained model
model = YOLO('runs/classify/train33/weights/best.pt')

# Validate the model on the validation dataset
results = model.val(data='datasets/fold_4')
print(results)

results in the same confusion matrix as my custom script:
confusion_matrix

So only the ClassificationValidator class seems to result in a confusing confusion matrix

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.