Error 1. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
Error Message:
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
Solution 1:
When debugging a program in pycharm, you can directly add these two statements in front of the program
import os
os.environ[“KMP_DUPLICATE_LIB_OK”]=“TRUE”
Solution 2:
If Method 1 fails to solve the problem, even importing torch directly on the terminal will cause this problem:
The reason for this is actually that there are two libiomp5md.dll files in the environment of anaconda. So go directly to the path of the virtual environment and search for this file, you can see that there are two dll files in the environment.
The first one is in the path of torch, and the second one is in the path of virtual environment itself. Go to the second directory and cut it to other paths for backup (it is better to back up the path as well).
Error 2.ModuleNotFoundError: No module named ‘mmcv._ext ‘
When using the target detection open source tool MMDetection, the following error occurs:
ModuleNotFoundError: No module named 'mmcv._ext'
It is likely that you did not specify a version when you started the installation of mmcv-full and chose to install it directly, as follows:
pip install mmcv-full
By default, mmcv full is installed. If it does not match the cuda and torch versions in your environment, the above error is likely to occur
Uninstall the original mmcv
pip uninstall mmcv-full
Reinstall the correct version of mmcv full
where {cu_version}, {torch_version} correspond to the version numbers of cuda and torch respectively
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
For example, I installed cuda10.2 and pytorch 1.8.0, so I should enter the command:
pip install mmcv-full==1.2.4 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html
Note: mmcv-full I recommend version 1.2.4.
Read More:
- [Solved] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
- Error starting vue project these dependencies were not found:create in ./src/router/modules/md.js
- [Solved] Error C1189: #error: Please use the /MD switch for _AFXDLL builds
- How to Solve VScode 2022 error: msvcp110d.dll not found
- Solution: from. Import ft2font importerror: DLL load failed: the specified module cannot be found
- MindSpore Error: [ERROR] MD:unexpected error.Not a valid index
- [Solved] Tensorflow Win10: ImportError: DLL load failed
- [Solved] Mac Cmake Complie openmp Error: fatal error: ‘omp.h‘ file not found
- DingDing Error: missing mainframe dll [How to Solve]
- [Solved] Could not load library cudnn_cnn_infer64_8.dll. Error code 126
- Python Importerror: DLL load failed: the page file is too small to complete the operation.
- [Solved] Jupyter Kernel error: kernel Cannot Connect—-import win32api; ImportError: DLL load failed…
- Jupyter specifies that the port is open; Importerror: DLL load failed error
- How to Solve Hadoop Missing Hadoop.dll and winutils.exe file error
- How to Fix Word Opening Error: the resource dll cannot be loaded
- [Solved] QT error: the packaged exe of Enigma virtual box reports an error cannot load library qt5core.dll
- [Solved] Runtimeerror during dcgan training: found dtype long but expected float
- [Solved] MSP430F5529 Error initializing emulator:No USB FET was found
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- [Solved] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and