[Solved] AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘

When running detect.py for inference testing after yolov5 training is complete, this error occurs:

The specific error is as follows:

Solution:

1. Click the error reporting method below to enter:

2. Modify to the following code:

Done!

Read More: