I am currently working on integrating the Convolutional Block Attention Module (CBAM) into the YOLOv9 model. Here are the steps I followed to add CBAM:
-Modified the yolo.py file to support the CBAM module.
-Added the CBAM module in common.py.
-Updated the model configuration YAML file to include CBAM.
However, when I run the training script, I encounter the following error:
ValueError: Input and output must have the same number of spatial dimensions, but got input with spatial dimensions of [16] and output size of torch.Size([32, 32]). Please provide input tensor in (N, C, d1, d2, ...,dK) format and output size in (o1, o2, ...,oK) format.
The error seems to occur when applying the CBAM module, particularly when the tensor dimensions do not match as expected.
Does anyone have suggestions or advice on how to resolve this dimension mismatch issue when integrating CBAM into YOLOv9? Thank you in advance for your assistance!
I am currently working on integrating the Convolutional Block Attention Module (CBAM) into the YOLOv9 model. Here are the steps I followed to add CBAM:
-Modified the yolo.py file to support the CBAM module. -Added the CBAM module in common.py. -Updated the model configuration YAML file to include CBAM. However, when I run the training script, I encounter the following error: ValueError: Input and output must have the same number of spatial dimensions, but got input with spatial dimensions of [16] and output size of torch.Size([32, 32]). Please provide input tensor in (N, C, d1, d2, ...,dK) format and output size in (o1, o2, ...,oK) format.
The error seems to occur when applying the CBAM module, particularly when the tensor dimensions do not match as expected. Does anyone have suggestions or advice on how to resolve this dimension mismatch issue when integrating CBAM into YOLOv9? Thank you in advance for your assistance!