YOLOV5 | AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor' problem solving Pro test is effective

报错:AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’

As shown in the picture:
insert image description here

Solution

1. Click the path of the error line to enter the edit page
insert image description here


2. Modify the original code (lines 153-154) to the following (line 155):
insert image description here
namely:

return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)

problem solved

After saving, run detect.py again, you can: Let’s
insert image description here


take a look at the training results
insert image description here

insert image description here

Precautions

Before running detect.py, you should put the weight file corresponding to YOLOV5 in the project folder:
insert image description here
here is the official weight file, you can click the link below to download it yourself:

YOLOv5 weight file

https://download.csdn.net/download/weixin_43401024/85225886

Guess you like

Origin blog.csdn.net/weixin_43401024/article/details/124428432