-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cannot import name '_registerMatType' from 'cv2.cv2' #1494
Comments
Had similar issue and it started a few hours ago. It seems like the problem comes from a version of opencv. Now the version of opencv that is downloaded is 4.5.5:
But before it was 4.5.4:
When trying to import fiftyone, the following error appears:
Because '_registerMatType' is a part of OpenCV 4.5.4. Any solution available for this issue? |
@Saransh-cpp
It worked for me. |
Thanks, @valentindbdg! This works! My initial guess was right 😄. I guess there is no way to make it work without the extra uninstall and install commands? |
fiftyone
on Google Colab
gives an error
Per @valentindbdg's helpful suggestion, it seems that the issue is that multiple versions of OpenCV are being installed: opencv/opencv-python#591 FiftyOne's requirements simply request any version of Line 82 in b9b5b06
I just tried this out myself and found that Colab's default environment has
|
There's a detailed discussion of this issue at aleju/imgaug#473. I see that they ended up modifying their I haven't studied the full discussion in the issue in detail, but at a quick glance it seems that is still not a complete solution, however. |
Thank you @brimoor! |
Thanks, @brimoor, and @valentindbdg! I finally found the root problem - I tried installing
and voila, everything worked. The import statement worked after installing
So the root problem is the presence of |
Also yes, I tried this but modifying the |
@Saransh-cpp thanks for the extra investigation. The issue is not For example, on my local machine I have these installed and everything works:
But in Colab, after
which doesn't work. The consensus online seems to be that having any pair of It's worth noting that FiftyOne has been running in Colab fine for a long time now. This issue popped up due to either a new OpenCV release or a change in Colab's default OpenCV versions. |
The simplest workaround is to install the last working version of
Update: as of
which should avoid installing any duplicate OpenCV versions (at the cost of not leveraging our prebuilt wheel). If you're reading this AFTER a failed FiftyOne import in Colab, the fastest solution is to:
|
@brimoor, yes that makes more sense. Thanks, @benjaminpkane! This works too! |
Another workaround is to upgrade dependencies upfront.
|
System information
pip
fiftyone --version
):0.14.2
3.7.12
Commands to reproduce
Run the following in a
Colab
notebook -Describe the problem
Running the commands above in a Colab notebook (
quickstart.ipynb
) gives an import error. My initial guess is that this is a version conflict issue but I couldn't explore this a lot as I am not familiar withfiftyone
(a new user).Code to reproduce issue
Other info / logs
What areas of FiftyOne does this bug affect?
App
: FiftyOne application issueCore
: Corefiftyone
Python library issueServer
: Fiftyone server issueWillingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?
from the FiftyOne community.
The text was updated successfully, but these errors were encountered: