Getting OSError: libnccl.so.2 while importing mxnet - nvidia

My configurations are:
gpu: Nvidia GeForce MX450 with 2GB Graphics Card
Cuda version: 10.1
MxNet Version: mxnet-cu101: 1.8.0
While trying to mxnet using import mxnet I am getting the following error:
OSError: libnccl.so.2: cannot open shared object file: No such file or directory
I have been using mxnet for last 2years, but never faced the issue before. As far as I knew mxnet installed them on their own as dependencies. However it didn't happen this time.

This happens only in mxnet-cu101==1.8.0 version. I downgraded to mxnet-cu101==1.7 and the problem got fixed.

or you can upgrade to newer version:
pip install mxnet-cu110==2.0.0a0
this solved the issue

Related

EasyOCR disables Cuda GPU when installed

Hello after installing EasyOCR via pip install easyocr via Anaconda Prompt (base) I receive this error.
OpenCV(4.5.4)
D:\a\opencv-python\opencv-python\opencv\modules\core\include\opencv2/core/private.cuda.hpp:106: error: (-216:No CUDA support) The library is compiled without CUDA
support in function 'throw_no_cuda'
Before installing easyocr, cuda is active and working with my GPU, but is disabled after installing EasyOCR.
I complied my build via Cmake using opencv4.5.4 and opencv-contrib4.5.4 with Cuda 11.3.1 and Cudnn 8.4.0 as well as uprading tot he most recent numpy 1.22.3.
It seems that after installing eascyOCR is changes my opencv build from whatever I am using to "opencv-python-headless-4.5.4.60" and that is I believe where the issues is at.
This is the version of easyocr installed.
Downloading opencv_python_headless-4.5.4.60-cp39-cp39-win_amd64.whl (35.0 MB)
Successfully installed easyocr-1.4.2 opencv-python-headless-4.5.4.60 python-bidi-0.4.2
Any idea or help on how I can get easyocr working with Cuda and my GPU?
Solved,
Have to install EasyOCR first
Then build OPENCV

Updating opencv to version 4.5.1

I need to update opencv to version 4.5.1 because there is a function that is not implemented in my current version 3.4.2. (I need to use the SIFT_create function, when I google a bit it seems that they removed it from 3.4.2 because of a patent. However, I have also heard from someone that this function has a different name in 3.4.2, so if you know this different name this is fine as well. I googled it but couldn't find anything about it.)
I tried updating opencv in the anaconda navigator but that didn't work. I tried typing
pip install opencv-python==4.0.0.21
(if I replaced 4.0.0.21 by 4.5.1 it couldn't find the version), but when I type
cv2.__version__
afterwards it still says I'm using version 3.4.2. I found this post: How to upgrade OpenCV in Anaconda (windows)? which says I should use
conda install -c conda-forge opencv=4.3.0
I do this, both the exact same command and the command with 4.3.0 replaced by 4.5.1 but in both cases I only get version 4.0.0 (which apparently also doesn't have the SIFT_create function).
Any idea what I could do?
In the meanwhile I found the answer myself (or rather: with the help of non-internet people).
The problem was that while trying to update opencv, I ended up having two versions of opencv at once. I had opencv 4.5.1 and at the same time I had opencv-python 4.0.0.21 installed. When importing opencv, it chose to import opencv-python in stead of just opencv. When I deleted the opencv-python this fixed the problem.

Prompt-toolkit version issue- incompatible with rasa-core and spyder

I am training a question answering model with rasa-nlu and rasa-core from terminal, wherein it requires the version of prompt-toolkit to be less than version 2.0.0 and when I try to open spyder IDEfrom Anaconda prompt, it is throwing error as it is expecting the prompt-toolkit version to be greater than 2. If I upgrade the version of prompt-toolkit the rasa-core code throws error in terminal. Is there any way to overcome this problem?
This was due to the not maintained dependency for PyInquirer in Rasa Core.
The library PyInquirer is replaced in the new Rasa Core release 0.13.0 with the library questionary. If you already want to have the latest release you can use the latest alpha version, by doing pip install rasa_core==0.13.0a5.

sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed

So I am trying to use:
sift = cv2.xfeatures2d.SIFT_create()
and it is coming up with this error:
cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented)
This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake
option and rebuild the library in function 'cv::xfeatures2d::SIFT::create'
I am using Python 3.5.0 and opencv(3.4.3) and I am just using idle. This occured after I tried to install TensorFlow and I have tried looking around and have installed opencv-contrib-python but I am still getting the same error. Thank you in advance and I apologise if I have not included enough info
I had the same problem. It seems that SIRF and SURF are no longer available in opencv > 3.4.2.16. I chose an older opencv-python and opencv-contrib-python versions and solved this problem. Here is the history version about opencv-python, and I use the following code :
pip install opencv-python==3.4.2.16
pip install opencv-contrib-python==3.4.2.16
Edit
For Anaconda User just this instead of pip
conda install -c menpo opencv
this will install cv2 3.4.1 and everything you need to run SIFT
Since SIFT patent expired, SIFT has been moved to the main repo.
To use SIFT in Opencv, You should use cv2.SIFT_create() instead of cv2.xfeatures2d.SIFT_create() now. (xfeatures2d only exists in the contrib package, but sift is part of the main package now.)
Below link will be helpful.
https://github.com/opencv/opencv/issues/16736
Edit: The opencv-contrib-python-nonfree was removed from pypi.
On Linux/ MacOS, I've found a better solution! To access nonfree detectors use:
pip install opencv-contrib-python-nonfree
It may be due to a mismatch of opencv version and opencv-contrib version.
If you installed opencv from the source using CMake, and the source version is different from the version of opencv-contrib-python, uninstall the current opencv-contrib-python and do pip install opencv-contrib-python==<version of the source>.X or an another compatible version.
One version setup that I have running is opencv source (3.2), opencv-python (3.4.0.14) and opencv-contrib-python (3.4.2.17)

Issue building OpenCV with ccache and CUDA

Trying to build OpenCV 3.3.1 with CUDA support, using ccache:
Ubuntu 16.04 LTS
OpenCV 3.3.1
CUDA 8.0
CCACHE 3.2.4
Make fails for .cu files, giving error:
/usr/bin/ccache: invalid option -- 'E'
Usage:
ccache [options] ...
I've added the /usr/lib/ccache to PATH, which cc and which c++ outputs /usr/lib/ccache/cc and /usr/lib/ccache/c++ respectively. Manually added a symlink for nvcc in /usr/lib/ccache directory, but now OpenCV CMakeLists.txt cannot find CUDA.
But interestingly I can build this sample CUDA code, with this CMake file without any issue.
I've searched the net and read most posts on SO and other forums, but had no success. I've had this issue for previous versions of OpenCV as well, but always disabled ccache as a solution.
Can someone please explain the reason behind this error?
Trying to set
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda
seems to solve this problem for me.

Resources