mmdet中模型测试出错_pickle.UnpicklingError: invalid load key, ‘/’.
环境:mmcv2.0.0,pytorch1.12.1, cuda11.3
测试:
tools/dist_test.sh configs/myself/mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1.py work_dirs/mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1/last_checkpoint 4
输出:
Traceback (most recent call last):
…
_pickle.UnpicklingError: invalid load key, ‘/’.
…
解决:
把权重文件last_checkpoint换成具体的权重文件的名称,如epoch_12.pth
tools/dist_test.sh configs/myself/mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1.py work_dirs/mask-rcnn_r50_fpn_sample1e-3_ms-1x_lvis-v1/epoch_12.pth 4