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

Validation metrics = 0.0 during training yolo-nas #2022

Open
Zat-Code opened this issue Jun 18, 2024 · 0 comments
Open

Validation metrics = 0.0 during training yolo-nas #2022

Zat-Code opened this issue Jun 18, 2024 · 0 comments

Comments

@Zat-Code
Copy link

💡 Your Question

Hi !

i want fine-tuning yolo-nas-m.

i use coco_detection_yolo_format_train and coco_detection_yolo_format_val for load my dataset (in Darknet/Yolo format).

image

when i do :

self.val_data.dataset.get_random_sample(), the console display me a coherent data in coco format.

i have already use this dataset for train yolov7 model and it's work.

training_params = {
            'silent_mode': False,
            'average_best_models': True,
            'warmup_mode': "LinearEpochLRWarmup",
            'warmup_initial_lr': 0.00001,
            'lr_warmup_epochs': 3,
            'initial_lr': {"backbone": 0.01, "default": 0.1},
            'lr_mode': "cosine",
            'cosine_final_lr_ratio': 0.1,
            'optimizer': "Adam",
            'optimizer_params': {weight_decay: 0.0001},
            'zero_weight_decay_on_bias_and_bn': True,
            'ema': True,
            'ema_params:' {"decay": 0.9, "decay_type": "threshold"},
            "mixed_precision": True,
            "max_epochs": self.epochs,
            "transforms": self.load_transform_param(),
            "loss": PPYoloELoss(
                use_static_assigner=False,
                num_classes=len(self.classes),
                reg_max=16
            ),
            "train_metrics_list": [ 
            ],
            "valid_metrics_list": [
                DetectionMetrics_050(
                    score_thres=0.1,
                    top_k_predictions=300,
                    num_cls=len(self.classes),
                    normalize_targets=True,
                    calc_best_score_thresholds=True,
                    post_prediction_callback=PPYoloEPostPredictionCallback(
                        score_threshold=0.01,
                        nms_top_k=256,
                        max_predictions=100,
                        nms_threshold=0.7
                        )
            )],
            "metric_to_watch": 'F1@0.50',
            "greater_metric_to_watch_is_better": True,
            "phase_callbacks" : 
                [
                ExtremeBatchDetectionVisualizationCallback(
                    metric=DetectionMetrics_050(
                    score_thres=0.1,
                    top_k_predictions=300,
                    num_cls=len(self.classes),
                    normalize_targets=True,
                    post_prediction_callback=PPYoloEPostPredictionCallback(
                        score_threshold=0.01,
                        nms_top_k=1000,
                        max_predictions=300,
                        nms_threshold=0.7
                        )
                    ),
                    classes=self.classes,
                    metric_component_name = 'mAP@0.50',
                    post_prediction_callback=PPYoloEPostPredictionCallback(
                        score_threshold=0.25,
                        nms_top_k=1000,
                        max_predictions=300,
                        nms_threshold=0.7
                        ),
                    normalize_targets=True
                )
            ]
        }

when i launch my training, this is the prompt cmd :

image

after a bit of searching, I saw that this could be due to a dataset that has no positive objects.
Of the two classes in my dataset, I've only annotated my second class. Could this be the cause of my problem?

on yolov7 I have no problem, and I've indicated in my dataset_params the 'class_inclusion_list' argument with my second class

Thank you in advance for an answer !

Versions

No response

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

1 participant