Yolov5进阶之八 高低版本格式转换问题

yolov5 6.0 之后 pt权重文件发生了变化,不能于5.0 pt混用,导致原有5.0版本很多时候要自己训练数据集。
下面提供一种yolov5 5.0 调用 最新 yolov5 6.0 6.1 权重文件的方法。
直接适用 6.0 数据集,执行

python detect.py --source 0

AttributeError: Can’t get attribute ‘SPPF’ on
是由于 5.0 没有SPPF 类,将6.0 的SPPF类复制到model下的common.py 并在头部加入 import warnings
继续执行上面命令,提示
if ‘youtube.com/’ in url or ‘youtu.be/’ in url: # if source is YouTube video
TypeError: argument of type ‘int’ is not iterable
这个问题进阶六解释了,只需要在 dataset.py 里url变为 str(url),连续两处。
再次执行,
RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton dimension 3
这个最难办,就是新版本这个函数2维变3维了,打开model下的yolo.py,准备把 6.0 的yolo.py 部分赋值过来,两个函数 def forward(self, x):和def _make_grid(self, nx=20, ny=20, i&#

你可能感兴趣的:(图像处理,开源系统,深度学习,人工智能)