[Solve error reporting] YOLOv5 Grad CAM error reporting: keyerror:cv3

Problem Description

After YOLOv5 added the attention mechanism, Grad CAM reported an error: keyerror:cv3
insert image description here

Cause Analysis:

After adding the attention mechanism, the number of layers of the model changes, print it out, and see which layer is changed.
Original network layer:
insert image description here
Original network layer: After adding the attention mechanism, the network layer changes

insert image description here

solution:

default='model_23_cv3_act'
改为:
default='model_24_cv3_act',

Guess you like

Origin blog.csdn.net/wahahaha116/article/details/129000560