高算平台yolov5模型,更换权重到yolov5x,报错:PytorchStreamReader failed reading zip archive: failed finding central directory
解决办法1:The 1.6 release of PyTorch switched ``torch.save`` to use a newzipfile-based file format.
``torch.load`` still retains the ability toload files in the old format. If for any reason you want ``torch.save``to use the old format, pass the kwarg ``_use_new_zipfile_serialization=False``.
是参数保存出了问题,将前面训练的参数,删除,并在重新训练,同时,在保存参数的地方添加
网上这一种解法不行。最后发现服务器里之前上传的yolov5x比实际的权重文件少零点几M,则原因出在权重文件,重新上传后解决。
解决办法2:weights = 'yolov5s.pt'
ckpt = torch.load(weights, map_location=device)
加载权重文件遇到的报错
原因pt文件传输过程中,没有传输完整
重新上传或者下载pt文件