Tag Archives: yolov5

[Solved] yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘

Preface: using yolov5-6.0 version, you want to detect several pictures, but there is a problem in the title. It can be seen that the upsampling function is not quite right. Now record the solution.

Version: yolov5-6.0, python3.8, pytorch1.11.0

1. Problem recurrence

2. Official website solution

This problem first appeared in yolov5 and is related to pytoch 1.11.0.

In other words, this problem may be encountered in both train and detect. The following is the solution to reduce the pytoch version to less than 10.

Then the blogger made a fix for PyTorch version 1.11.0

But it doesn’t seem to be solved. The my torch version is 1.11.0, but this problem still occurs.

The solution of modifying the upper sampling function given by netizens.

Just Comment out this part below.

It’s really solved.

NDK Version Clang++: error: unknown argument: ‘-static-openmp‘

Cmakelists.txt file compiles ncnn and CPP and runs normally on the other two Ubuntu machines.

Similarly, the source code is configured, the project is loaded, and the gradle initialization is correct, but there is an error in compiling APK.

clang++: error: unknown argument: ‘-static-openmp’

After searching for a long time, I can’t see the wrong configuration. I doubt the gradle version. The problem remains after the upgrade; Upgrade the as version, and the problem still occurs.

Open settings, SDK configuration, check SDK tools, and reinstall SDK. The latest SDK 23.0 is installed at once. The error disappears, but there is still a problem with the compilation. It is reduced to SDK 20.0, and the error occurs again.

High or low, choose ndk21.3 and cmake3.10.2. Finally, the compilation is normal and the debugging is passed.