使用cbam插件后,训练结束时map有提升,但是在推理时根本一个也预测不出来 #999
2660383028
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
终端显示:
PS F:\ssq> python mmyolo/demo/image_demo.py data_small_test/images mmyolo/configs/custom_dataset/with_cbam.py work_dirs_LLVIP/with_cbam/best_coco_bbox_mAP_epoch_44.pth --out-dir data_small_test/out
!!!You are using
YOLOv5Head
with num_classes == 1. The loss_cls will be 0. This is a normal phenomenon.Loads checkpoint by local backend from path: work_dirs_LLVIP/with_cbam/best_coco_bbox_mAP_epoch_44.pth
The model and loaded state dict do not match exactly
unexpected key in source state_dict: backbone.stage1.2.channel_attention.fc.0.conv.weight, backbone.stage1.2.channel_attention.fc.0.conv.bias, backbone.stage1.2.channel_attention.fc.1.conv.weight, backbone.stage1.2.channel_attention
.fc.1.conv.bias, backbone.stage1.2.spatial_attention.conv.conv.weight, backbone.stage1.2.spatial_attention.conv.conv.bias, backbone.stage4.3.channel_attention.fc.0.conv.weight, backbone.stage4.3.channel_attention.fc.0.conv.bias, bac
kbone.stage4.3.channel_attention.fc.1.conv.weight, backbone.stage4.3.channel_attention.fc.1.conv.bias, backbone.stage4.3.spatial_attention.conv.conv.weight, backbone.stage4.3.spatial_attention.conv.conv.bias
F:\Miniconda3\envs\mmyolo2\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide the
save_dir
argument.warnings.warn(f'Failed to add {vis_backend.class}, '
F:\Miniconda3\envs\mmyolo2\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.TensorboardVisBackend'>, please provide the
save_dir
argument.warnings.warn(f'Failed to add {vis_backend.class}, '
[>>>>>>>>>>>>>>>>>>>>>> ] 9/20, 1.8 task/s, elapsed: 5s, ETA: 6sF:\Miniconda3\envs\mmyolo2\lib\site-packages\mmdet\visualization\palette.py:90: UserWarning: floordiv is deprecated, and its behavior
will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mo
de='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
scales = 0.5 + (areas - min_area) // (max_area - min_area)
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 20/20, 2.7 task/s, elapsed: 7s, ETA: 0s
Results have been saved at F:\ssq\data_small_test\out
代码修改:
model = dict(
backbone=dict(
plugins=[
dict(cfg=dict(type='CBAM'),
stages=(True, True, True, True)),
]),
bbox_head=dict(
head_module=dict(num_classes=num_classes),
prior_generator=dict(base_sizes=anchors),
Beta Was this translation helpful? Give feedback.
All reactions