I think I have a lot of errors needs to fully and deeply review the code and solve all errors in this file centernet_loss as it shows the following errors on running

#the file 

from functools import partial
from typing import Dict

import torch
from pytorch_toolbelt.losses import SoftBCEWithLogitsLoss, BinaryBiTemperedLogisticLoss, BinaryFocalLoss, BalancedBCEWithLogitsLoss
from torch import nn, Tensor
from torch.nn import functional as F

from .functional import binary_shannon_entropy_loss, objectness_reduced_focal_loss, objectness_mse_loss
from ..constants import (
    CENTERNET_OUTPUT_SIZE,
    CENTERNET_OUTPUT_OFFSET,
    CENTERNET_OUTPUT_OBJECTNESS_MAP,
    CENTERNET_TARGET_SIZE,
    CENTERNET_TARGET_OFFSET,
    CENTERNET_TARGET_FISHING_MAP,
    CENTERNET_OUTPUT_FISHING_MAP,
    CENTERNET_OUTPUT_VESSEL_MAP,
    CENTERNET_TARGET_VESSEL_MAP,
    CENTERNET_TARGET_OBJECTNESS_MAP,
)
from ...constants import IGNORE_LABEL, TARGET_SAMPLE_WEIGHT

__all__ = ["CircleNetLoss"]
from xview3.utils import TorchDevice
device = TorchDevice.choose_torch_device()

class CircleNetLoss(nn.Module):
    samplewise: bool
    regularize_ignored: bool

    def __init__(
        self,
        objectness_loss: str = "rfl",
        classifier_loss: str = "bce",
        size_loss: str = "mse",
        offset_loss: str = "mse",
        regularize_ignored: bool = False,
        regularization_weight: float = 1.0,
        ignore_index: int = IGNORE_LABEL,
    ):
        super().__init__()
        self.ignore_index = ignore_index  # Ensure ignore_index is set
        self.objectness_loss = partial(objectness_mse_loss, ignore_index=ignore_index) if objectness_loss == "mse" else partial(objectness_reduced_focal_loss, ignore_index=ignore_index)
        self.classifier_loss = SoftBCEWithLogitsLoss(ignore_index=ignore_index, reduction="none")
        self.size_loss = mse_loss if size_loss == "mse" else smooth_l1_loss
        self.offset_loss = mse_loss if offset_loss == "mse" else l1_loss
        self.regularize_ignored = regularize_ignored
        self.regularization_weight = regularization_weight

        if objectness_loss == "rfl":
            self.objectness_loss = partial(objectness_reduced_focal_loss, ignore_index=self.ignore_index, alpha=2, beta=4, eps=0)
        elif objectness_loss == "mse":
            self.objectness_loss = partial(objectness_mse_loss, ignore_index=self.ignore_index)
        else:
            raise KeyError(objectness_loss)

        if classifier_loss == "bce":
            self.classifier_loss = SoftBCEWithLogitsLoss(ignore_index=ignore_index, reduction="none")
        elif classifier_loss == "bbce":
            self.classifier_loss = BalancedBCEWithLogitsLoss(ignore_index=ignore_index, reduction="none")
        elif classifier_loss == "soft_bce":
            self.classifier_loss = SoftBCEWithLogitsLoss(ignore_index=ignore_index, reduction="none", smooth_factor=0.05)
        elif classifier_loss == "bitempered":
            self.classifier_loss = BinaryBiTemperedLogisticLoss(t1=0.5, t2=4.0, ignore_index=ignore_index, reduction="none")
        elif classifier_loss == "focal":
            self.classifier_loss = BinaryFocalLoss(ignore_index=ignore_index, alpha=None, reduction="none")
        else:
            raise KeyError(classifier_loss)

        if size_loss == "huber":
            self.size_loss = huber_loss
        elif size_loss == "mse":
            self.size_loss = mse_loss
        elif size_loss == "smooth_l1":
            self.size_loss = smooth_l1_loss
        elif size_loss == "rel_error":
            self.size_loss = relative_length_error
        else:
            raise KeyError(size_loss)

        if offset_loss == "mse":
            self.offset_loss = mse_loss
        elif offset_loss == "l1":
            self.offset_loss = l1_loss
        elif offset_loss == "smooth_l1":
            self.offset_loss = smooth_l1_loss
        elif offset_loss == "huber":
            self.offset_loss = huber_loss
        elif offset_loss is None:
            self.offset_loss = None
        else:
            raise KeyError(offset_loss)

    def forward(self, **kwargs) -> Dict[str, Tensor]:
        gt_objectness: Tensor = kwargs[CENTERNET_TARGET_OBJECTNESS_MAP]
        gt_is_vessel: Tensor = kwargs[CENTERNET_TARGET_VESSEL_MAP]
        gt_is_fishing: Tensor = kwargs[CENTERNET_TARGET_FISHING_MAP]
        gt_size: Tensor = kwargs[CENTERNET_TARGET_SIZE]

        # Check if TARGET_SAMPLE_WEIGHT is present, if not, provide a default value
        sample_weights = kwargs.get(TARGET_SAMPLE_WEIGHT, torch.ones_like(gt_objectness)).reshape(-1, 1, 1, 1)  # [B,1,1,1]

        # Check if CENTERNET_OUTPUT_OBJECTNESS_MAP is present, if not, provide a default value
        pred_objectness: Tensor = kwargs.get(CENTERNET_OUTPUT_OBJECTNESS_MAP, torch.zeros_like(gt_objectness))
        pred_is_vessel: Tensor = kwargs.get(CENTERNET_OUTPUT_VESSEL_MAP, torch.zeros_like(gt_is_vessel))
        pred_is_fishing: Tensor = kwargs.get(CENTERNET_OUTPUT_FISHING_MAP, torch.zeros_like(gt_is_fishing))
        pred_size: Tensor = kwargs.get(CENTERNET_OUTPUT_SIZE, torch.zeros_like(gt_size))

        if pred_is_vessel.shape[1] != gt_is_vessel.shape[1]:
            gt_is_vessel = gt_is_vessel[:, :pred_is_vessel.shape[1], :, :]
        if pred_is_fishing.shape[1] != gt_is_fishing.shape[1]:
            gt_is_fishing = gt_is_fishing[:, :pred_is_fishing.shape[1], :, :]

        peaks_mask = gt_objectness.eq(1)
        true_vessels_mask = gt_is_vessel.eq(1)

        num_objects = peaks_mask.sum(dtype=torch.float32).clamp_min(1.0)
        num_vessels = (true_vessels_mask & peaks_mask).sum(dtype=torch.float32).clamp_min(1.0)

        uncertain_objectness_mask = gt_objectness.eq(self.ignore_index)
        certain_objectness_mask = ~uncertain_objectness_mask

        # Returns unreduced losses
        pos_objectness_loss, neg_objectness_loss = self.objectness_loss(pred_objectness, gt_objectness, pos_mask=peaks_mask)

        # Weight classification loss by objectness (This make sense for target encoding=center).
        # This way pixels closer to the center of the keypoint will have bigger influence than ones on the periphery
        vessel_loss = self.classifier_loss(pred_is_vessel, gt_is_vessel) * gt_objectness * certain_objectness_mask
        fishing_loss = self.classifier_loss(pred_is_fishing, gt_is_fishing) * gt_objectness * certain_objectness_mask

        if self.regularize_ignored:
            uncertain_vessel_mask = gt_is_vessel.eq(self.ignore_index)
            uncertain_fishing_mask = (gt_is_fishing.eq(self.ignore_index) & gt_is_vessel.eq(1)) | uncertain_vessel_mask
            # Plus regularization loss for ignored values in the objectness heatmap
            obj_reg_loss = binary_shannon_entropy_loss(pred_objectness) * uncertain_objectness_mask

            vsl_reg_loss = binary_shannon_entropy_loss(pred_is_vessel) * uncertain_vessel_mask

            fsh_reg_loss = binary_shannon_entropy_loss(pred_is_fishing) * uncertain_fishing_mask

            obj_reg_loss = (
                obj_reg_loss.sum(dtype=torch.float32)
                * self.regularization_weight
                / uncertain_objectness_mask.sum(dtype=torch.float32).clamp_min(1.0)
            )

            vsl_reg_loss = (
                vsl_reg_loss.sum(dtype=torch.float32)
                * self.regularization_weight
                / uncertain_vessel_mask.sum(dtype=torch.float32).clamp_min(1.0)
            )
            fsh_reg_loss = (
                fsh_reg_loss.sum(dtype=torch.float32)
                * self.regularization_weight
                / uncertain_fishing_mask.sum(dtype=torch.float32).clamp_min(1.0)
            )
        else:
            obj_reg_loss = 0
            vsl_reg_loss = 0
            fsh_reg_loss = 0

        valid_size_mask = peaks_mask * (gt_size > 0)  # Size loss only for positive lengths
        num_objects_with_length = valid_size_mask.sum(dtype=torch.float32).clamp_min(1.0)

        # Reshape size_loss to match the shape of sample_weights
        size_loss = self.size_loss(pred_size, gt_size, valid_size_mask)
        size_loss = size_loss.view_as(sample_weights)

        size_loss = sample_weights * size_loss

        if self.offset_loss is not None:
            offset_loss = self.offset_loss(kwargs.get(CENTERNET_OUTPUT_OFFSET, torch.zeros_like(gt_size)), kwargs[CENTERNET_TARGET_OFFSET], peaks_mask).sum(
                dim=1, keepdim=True
            )
        else:
            offset_loss = torch.zeros_like(size_loss)

        print(f"vessel_loss shape: {vessel_loss.shape}")
        print(f"sample_weights shape: {sample_weights.shape}")

        batch_size = vessel_loss.size(0)  # 8
        spatial_dim = vessel_loss.size(2)  # 128
        sample_weights = sample_weights.squeeze().unsqueeze(1)  # [B, 1]

        # Reshape sample_weights to match the shape of vessel_loss
        # Obtain batch_size from gt_objectness
        batch_size = gt_objectness.size(0)

        # Initialize sample_weights with the correct shape
        sample_weights = kwargs.get(
            TARGET_SAMPLE_WEIGHT,
            torch.ones(batch_size, 1, device=gt_objectness.device)
        )  # Shape: [batch_size, 1]

        # Expand sample_weights to match vessel_loss spatial dimensions
        height, width = vessel_loss.shape[2], vessel_loss.shape[3]
        sample_weights = sample_weights.expand(-1, 1, height, width)

        # Now sample_weights has shape [batch_size, 1, height, width]

        sample_weights_expanded = sample_weights.view(batch_size, 1, 1, 1)
        weighted_vessel_loss = sample_weights_expanded * vessel_loss
        vessel_loss_reduced = weighted_vessel_loss.sum(dim=[2, 3])  # Shape: [batch_size, 1] # Shape: [batch_size, 1]
        print(f"pred_is_vessel shape: {pred_is_vessel.shape}")  # Should be [batch_size, channels, height, width]
        print(f"gt_is_vessel shape: {gt_is_vessel.shape}")
        print(f"pred_is_fishing shape: {pred_is_fishing.shape}")
        print(f"gt_is_fishing shape: {gt_is_fishing.shape}")
        print(f"vessel_loss shape: {vessel_loss.shape}")  # Expected: [batch_size, 1, height, width]
        print(f"sample_weights shape after expand: {sample_weights.shape}")  # Expected: [batch_size, 1, height, width]
        print(f"weighted_vessel_loss shape: {weighted_vessel_loss.shape}")  # Expected: [batch_size, 1, height, width]

        objectness_loss = neg_objectness_loss + pos_objectness_loss
        # Objectness loss is summed over spatial dimensions
        #sample_weights_obj = sample_weights.view(batch_size, 1)
        reduced_obj_loss = objectness_loss.sum(dim=[2, 3])  # Shape: [batch_size, 1]
        mean_obj_loss = (sample_weights * reduced_obj_loss).sum() / num_objects + obj_reg_loss # Sum over spatial dimensions

        if reduced_obj_loss.dim() < 4:
            raise ValueError("reduced_obj_loss has less than 4 dimensions")

        # Ensure reduced_obj_loss has the correct shape
        reduced_obj_loss = reduced_obj_loss.unsqueeze(-1).unsqueeze(-1)  # Add back spatial dimensions

        # Reshape sample_weights to match the shape of reduced_obj_loss
        sample_weights = sample_weights.view(reduced_obj_loss.shape[0], 1)
        mean_obj_loss = (sample_weights.squeeze() * reduced_obj_loss.squeeze()).sum(dtype=torch.float32) / num_objects + obj_reg_loss
        weighted_vessel_loss = sample_weights * vessel_loss
        weighted_fishing_loss = sample_weights * fishing_loss
        weighted_size_loss = sample_weights * size_loss

        mean_vessel_loss = weighted_vessel_loss.sum() / num_objects + vsl_reg_loss
        mean_fishing_loss = weighted_fishing_loss.sum() / num_vessels + fsh_reg_loss
        mean_size_loss = weighted_size_loss.sum() / num_objects_with_length

        losses = {
            "objectness": mean_obj_loss.type_as(pred_objectness),
            "vessel": mean_vessel_loss.type_as(pred_objectness),
            "fishing": mean_fishing_loss.type_as(pred_objectness),
            "size": mean_size_loss.type_as(pred_objectness),
            "vsl_reg_loss": vsl_reg_loss,
            "fsh_reg_loss": fsh_reg_loss,
            "obj_reg_loss": obj_reg_loss,
            "num_objects": num_objects,
            "num_vessels": num_vessels,
            "num_objects_with_length": num_objects_with_length,
        }
        if self.offset_loss is not None:
            mean_off_loss = offset_loss.sum(dtype=torch.float32) / num_objects
            losses["offset"] = mean_off_loss.type_as(pred_objectness)
        return losses


def mse_loss(prediction, target, pos_mask):
    loss = F.mse_loss(prediction, target, reduction="none") * pos_mask
    return loss


def l1_loss(prediction, target, pos_mask):
    loss = F.l1_loss(prediction, target, reduction="none") * pos_mask
    return loss


def smooth_l1_loss(prediction, target, pos_mask):
    loss = F.smooth_l1_loss(prediction, target, reduction="none") * pos_mask
    return loss


def huber_loss(prediction, target, pos_mask):
    loss = F.huber_loss(prediction, target, reduction="none", delta=1) * pos_mask
    return loss


def relative_length_error(prediction, target, pos_mask, eps=1e-4):
    loss = pos_mask * F.smooth_l1_loss(prediction, target, reduction="none") / (target + eps)
    return loss

class YOLOLoss(nn.Module):
    def __init__(self, num_classes, anchors):
        super(YOLOLoss, self).__init__()
        self.num_classes = num_classes
        self.anchors = anchors
        self.mse_loss = nn.MSELoss()
        self.bce_loss = nn.BCELoss()

    def forward(self, predictions, targets):
        # Implement YOLO loss calculation here
        # This is a placeholder and should be replaced with actual YOLO loss computation
        return self.mse_loss(predictions, targets)

#the  log of errors

python train_multilabel.py +config=configs/multilabel_circle_net.yaml
DEBUG:hydra.core.utils:Setting JobRuntime:name=UNKNOWN_NAME
DEBUG:hydra.core.utils:Setting JobRuntime:name=train_multilabel
Dataset valid_sar_cv
        ignore_low_confidence_detections False
        ignore_low_confidence_labels     False
        filter_low_confidence_objects    False
Train dataset
        Unknown vessels 90
        Unknown fishing 11242
Valid dataset
        Unknown vessels 20
        Unknown fishing 2778
Preparing training dataset: 100%|████████████████████████| 35/35 [00:00<00:00, 160.47it/s]
[DEBUG] self.box_coder in dataset.__init__: MultilabelCircleNetCoder(image_size=(512, 512), stride=4, max_objects=512, labels_encoding=circle, heatmap_encoding=umich, fixed_radius=None, ignore_index=-1, ignore_low_confidence_detections=False)
Preparing validation dataset: 100%|████████████████████████| 7/7 [00:00<00:00, 589.13it/s]
Train instances 13933 dataset 35 sampler 8192
Valid instances 3655 dataset 1039
[DEBUG] After adjustment, encoder.conv_stem.in_channels: 2
head_output_channels: 6
yolo_output_channels: 21
classifier_output_channels: 2
total_input_channels: 29
head_output_channels: 6
yolo_output_channels: 21
classifier_output_channels: 2
total_input_channels: 29
[DEBUG] model.box_coder after initialization: MultilabelCircleNetCoder(image_size=[768, 768], stride=1, max_objects=512, labels_encoding=circle, heatmap_encoding=umich, fixed_radius=None, ignore_index=-1, ignore_low_confidence_detections=False)
BoxCoder
MultilabelCircleNetCoder(image_size=[768, 768], stride=1, max_objects=512, labels_encoding=circle, heatmap_encoding=umich, fixed_radius=None, ignore_index=-1, ignore_low_confidence_detections=False)
DEBUG:rasterio.session:Could not import boto3, continuing with reduced functionality.
DEBUG:rasterio.session:Could not import boto3, continuing with reduced functionality.
DEBUG:rasterio.session:Could not import boto3, continuing with reduced functionality.
DEBUG:rasterio.session:Could not import boto3, continuing with reduced functionality.
DEBUG:rasterio.env:Entering env context: <rasterio.env.Env object at 0x339b67490>
DEBUG:rasterio.env:Entering env context: <rasterio.env.Env object at 0x33a26e460>
DEBUG:rasterio.env:Starting outermost env
DEBUG:rasterio.env:Starting outermost env
DEBUG:rasterio.env:No GDAL environment exists
DEBUG:rasterio.env:No GDAL environment exists
DEBUG:rasterio.env:New GDAL environment <rasterio._env.GDALEnv object at 0x339b67460> created
DEBUG:rasterio.env:New GDAL environment <rasterio._env.GDALEnv object at 0x33a26e430> created
DEBUG:rasterio.env:Entering env context: <rasterio.env.Env object at 0x31d020460>
DEBUG:rasterio.env:Starting outermost env
DEBUG:rasterio.env:No GDAL environment exists
DEBUG:rasterio.env:New GDAL environment <rasterio._env.GDALEnv object at 0x31d020430> created
DEBUG:rasterio._filepath:Installing FilePath filesystem handler plugin...
DEBUG:rasterio._filepath:Installing FilePath filesystem handler plugin...
DEBUG:rasterio._env:GDAL_DATA found in environment.
DEBUG:rasterio._env:PROJ_DATA found in environment.
DEBUG:rasterio._env:GDAL_DATA found in environment.
DEBUG:rasterio._env:PROJ_DATA found in environment.
DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x339b67460>.
DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x339b67490>
DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x33a26e430>.
DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x33a26e460>
DEBUG:rasterio._base:Sharing flag: 0
DEBUG:rasterio._base:Sharing flag: 0
DEBUG:rasterio._filepath:Installing FilePath filesystem handler plugin...
DEBUG:rasterio._env:GDAL_DATA found in environment.
DEBUG:rasterio._env:PROJ_DATA found in environment.
DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x31d020430>.
DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x31d020460>
DEBUG:rasterio._base:Sharing flag: 0
DEBUG:rasterio.env:Entering env context: <rasterio.env.Env object at 0x333bda460>
DEBUG:rasterio.env:Starting outermost env
DEBUG:rasterio.env:No GDAL environment exists
DEBUG:rasterio.env:New GDAL environment <rasterio._env.GDALEnv object at 0x333bda430> created
DEBUG:rasterio._filepath:Installing FilePath filesystem handler plugin...
DEBUG:rasterio._env:GDAL_DATA found in environment.
DEBUG:rasterio._env:PROJ_DATA found in environment.
DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x333bda430>.
DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x333bda460>
DEBUG:rasterio._base:Sharing flag: 0
DEBUG:rasterio._base:Nodata success: 1, Nodata value: -32768.000000
DEBUG:rasterio._base:Nodata success: 1, Nodata value: -32768.000000
DEBUG:rasterio._base:Nodata success: 1, Nodata value: -32768.000000
DEBUG:rasterio._base:Nodata success: 1, Nodata value: -32768.000000
DEBUG:rasterio._base:Dataset <open DatasetReader name='/Volumes/Crucial/xview3_dataset/full_dataset/full/validation/0157baf3866b2cf9v/VH_dB.tif' mode='r'> is started.
....

DEBUG:rasterio._env:GDAL_DATA found in environment.
DEBUG:rasterio._env:PROJ_DATA found in environment.
DEBUG:rasterio._env:Started GDALEnv: self=<rasterio._env.GDALEnv object at 0x33a0da850>.
DEBUG:rasterio.env:Entered env context: <rasterio.env.Env object at 0x33a0da6a0>
DEBUG:rasterio._io:Output nodata value read from file: -32768.0
DEBUG:rasterio._io:Output nodata values: [-32768.0]
DEBUG:rasterio._io:all_valid: False
DEBUG:rasterio._io:mask_flags: ([<MaskFlags.nodata: 8>],)
DEBUG:rasterio._io:Jump straight to _read()
DEBUG:rasterio._io:Window: Window(col_off=7136, row_off=5793, width=512, height=512)
DEBUG:rasterio._io:IO window xoff=7136.0 yoff=5793.0 width=512.0 height=512.0
objectness_map shape: torch.Size([4, 1, 64, 64])
vessel_map shape: torch.Size([4, 1, 64, 64])
fishing_map shape: torch.Size([4, 1, 64, 64])
size_map shape: torch.Size([4, 1, 64, 64])
offset_map shape: torch.Size([4, 2, 64, 64])
yolo_output shape: torch.Size([4, 21, 32, 32])
classification_output shape: torch.Size([4, 2, 32, 32])
...

(313.0, 86.0, 3.597093105316162) [<class 'float'>, <class 'float'>, <class 'float'>]
(398.0, 32.0, 2.4910855293273926) [<class 'float'>, <class 'float'>, <class 'float'>]
(340.0, 67.0, 3.1162779331207275) [<class 'float'>, <class 'float'>, <class 'float'>]
(495.0, 127.0, 3.5146052837371826) [<class 'float'>, <class 'float'>, <class 'float'>]
(263.0, 261.0, 3.0925166606903076) [<class 'float'>, <class 'float'>, <class 'float'>]
(303.0, 95.0, 3.993852138519287) [<class 'float'>, <class 'float'>, <class 'float'>]
(458.0, 76.0, 9.860709190368652) [<class 'float'>, <class 'float'>, <class 'float'>]
(412.0, 26.0, 5.390635013580322) [<class 'float'>, <class 'float'>, <class 'float'>]
Error executing job with overrides: ['+config=configs/multilabel_circle_net.yaml']
Traceback (most recent call last):
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel.py", line 560, in <module>
    main()
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/main.py", line 94, in decorated_main
    _run_hydra(
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
    _run_app(
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 457, in _run_app
    run_and_report(
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
    raise ex
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
    return func()
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
    lambda: hydra.run(
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 132, in run
    _ = ret.return_value
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/core/utils.py", line 260, in return_value
    raise self._return_value
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/hydra/core/utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel.py", line 556, in main
    CenternetPipeline(cfg).train()
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel.py", line 428, in train
    model = self.build_model(config, self.loaders)
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel.py", line 219, in build_model
    model = nas.search(config.get('nas', {}).get('num_iterations', 10), loaders['train'], loaders['valid'])
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/nas.py", line 37, in search
    scores = [self.evaluation_function(model, train_loader, val_loader) for model in population]
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/nas.py", line 37, in <listcomp>
    scores = [self.evaluation_function(model, train_loader, val_loader) for model in population]
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/train_multilabel.py", line 528, in evaluate_architecture
    return model.evaluate_architecture(model, train_loader, val_loader)
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/centernet/models/centernet_unet.py", line 255, in evaluate_architecture
    loss = model.calculate_loss(outputs, targets)
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/centernet/models/centernet_unet.py", line 235, in calculate_loss
    circle_net_loss = self.circle_net_loss(**outputs, **targets)
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/anaconda3/envs/sam3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/samerkharboush/Downloads/SAR-MPS-OptunaNasFbnYoloTransformers/xview3/centernet/losses/circlenet_loss.py", line 198, in forward
    sample_weights = sample_weights.expand(-1, 1, height, width)
RuntimeError: The expanded size of the tensor (128) must match the existing size (4) at non-singleton dimension 2.  Target sizes: [-1, 1, 128, 128].  Tensor sizes: [4, 1]
(sam3) samerkharboush@Samers-MBP SAR-MPS-OptunaNasFbnYoloTransformers %