Giter VIP home page Giter VIP logo

Comments (7)

roydenwa avatar roydenwa commented on May 31, 2024 2

opencv-python==4.8.0.74 seems to work. I will open a PR.

from deep_privacy2.

Gordon-4389 avatar Gordon-4389 commented on May 31, 2024

Hi,

I've encountered the same problem (opencv-python==4.5.5.64), can you let me know what version of opencv version you switched to in order to resolve it?

from deep_privacy2.

Gordon-4389 avatar Gordon-4389 commented on May 31, 2024

It appears updating open-cv to another version doesn't really work for me, as I just get the error when running:

Traceback (most recent call last): File "anonymize.py", line 1, in <module> import cv2 File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module> bootstrap() File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 175, in bootstrap if __load_extra_py_code_for_module("cv2", submodule, DEBUG): File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module py_module = importlib.import_module(module_name) File "/opt/conda/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/opt/conda/lib/python3.8/site-packages/cv2/gapi/__init__.py", line 301, in <module> cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

Googling the errors appear to show that its caused by to multiple opencv installations, but adding the line:
RUN pip uninstall opencv-python opencv-contrib-python opencv-contrib-python-headless opencv-python-headless --yes
before installing dependencies in the docker file doesn't appear change anything.

from deep_privacy2.

roydenwa avatar roydenwa commented on May 31, 2024

You are right my workaround is to change the entry point of the container to start a bash terminal and then install pip install opencv-python==4.8.0.74 in the container. Afterwards, running the anonymize.py script works. However, I also don't know why changing the opencv version in the Dockerfile throws the GStreamer error.

from deep_privacy2.

XinyueZ avatar XinyueZ commented on May 31, 2024

nothings worked, after tried those approaches

    import cv2
  File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "/opt/conda/lib/python3.8/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)
  File "/opt/conda/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/conda/lib/python3.8/site-packages/cv2/mat_wrapper/__init__.py", line 33, in <module>
    cv._registerMatType(Mat)
AttributeError: partially initialized module 'cv2' has no attribute '_registerMatType' (most likely due to a circular import)

from deep_privacy2.

NiuNiuBoom avatar NiuNiuBoom commented on May 31, 2024

opencv-python==4.8.0.74 seems to work. I will open a PR.

tks,my problem solved!

from deep_privacy2.

cstenkamp avatar cstenkamp commented on May 31, 2024

opencv-python==4.8.0.74 does not work for me, however opencv-python-headless==4.5.5.64 does! I also needed to add ftfy==6.1.3 as requirement into the Dockerfile as well.

from deep_privacy2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.