When YOLOV5 uses detect.py to call the camera for real-time recognition, 'Upsample' object has no attribute 'recompute_scanle_factor
the error reporting
Go to the python library to find upsampling.py and open it, as shown in the figure below;
Modify upsampling.py, the modified result is as follows:
def forward(self, input: Tensor) -> Tensor:
# return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
# recompute_scale_factor=self.recompute_scale_factor)
return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)
Save the modification, and then run detect.py to call the camera recognition