1. ValueError: size shape must match input shape. Input is 2D, size is 1
这种是尺寸没对上,用input.shape
和targe.shape
把尺寸弄清楚,我缺的是通道那一维,用torch.unsqueeze(input, 1)
就行了
2. KeyError: ‘layers.0.blocks.0.attn.relative_position_bias_table’
这通常是别人的权重拿到自己的网络没转换的原因
3. KeyError: ‘data_time’
mmseg在保存权重时出现的问题
在mmseg/apis/train.py
里,加上priority='LOW'
同时,如果想保存最佳结果,可以加上save_best='mIoU'
,或其他指标
runner.register_hook(eval_hook(val_dataloader