Build and Install OpenCV With CUDA (GPU) Support on Windows 10

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 263

  • @TheCodingBug
    @TheCodingBug  3 роки тому +3

    Follow Install CUDA and cuDNN part: ua-cam.com/video/PlW9zAg4cx8/v-deo.html
    Updated Tutorial for OpenCV 4.5.1 with Virtual Environment Build: ua-cam.com/video/YsmhKar8oOc/v-deo.html
    YOLOv4 with Darknet on Windows:
    ua-cam.com/video/FE2GBeKuqpc/v-deo.html
    YOLOv3 YOLOv4 with OpenCV:
    ua-cam.com/video/FjyF03uawsA/v-deo.html
    YOLOv4 Darknet:
    ua-cam.com/video/FE2GBeKuqpc/v-deo.html
    YOLOv4 Custom Detector:
    ua-cam.com/video/sKDysNtnhJ4/v-deo.html
    YOLOv4 TensorFlow and TFLite:
    ua-cam.com/video/tCmC7nyfJp8/v-deo.html

  • @danniel90
    @danniel90 3 роки тому +2

    Notes:
    1. Uninstall VS Python
    2. Install latest Anaconda3(python 3.8.5)
    3. Uninstall included Numpy, install numpy==1.19.3
    4. Install appropiate Nvidia CUDA, get developer cuDNN files and merge them with CUDA
    Thanks for the video it helped me 10x!

    • @nitinkumar29
      @nitinkumar29 3 роки тому

      Installing Anaconda is not necessary, I always used Eclipse and never had problem with the compilation.

  • @gamingin768p7
    @gamingin768p7 3 роки тому +1

    Thank You so much sir.I don't have words to express my gratitude.I badly needed to get OpenCV running with CUDA for my college project,and I was running out of time.I've spent many,many hours of the past week trying to get this work.I do not have much experience in such stuff and I couldn't find a detailed step by step video on this topic.Thank you so much once again.You made my day!

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      I am glad it was helpful.

    • @gamingin768p7
      @gamingin768p7 3 роки тому +1

      @@TheCodingBug Straight up the best video on this topic on UA-cam.Thank you for making this video.

  • @avnibalkc5066
    @avnibalkc5066 3 роки тому +4

    Mate, it was the most helpful video I have ever watched on UA-cam. Thank you very much, respect.

  • @mewhenthemewhenstheme
    @mewhenthemewhenstheme 8 місяців тому

    Out of all the tutorials I've found for this stuff, this one was by far the best. Thanks a lot.

  • @keyurborad8550
    @keyurborad8550 2 роки тому

    A big shoutout for you. You made very precise and simple video explaining all the step with clarity. I would definitely share your channel to my peers.
    Thanks a lot!!

  • @dedenapraia
    @dedenapraia 3 роки тому +1

    Thanks you very much. For those struggling with the "ModuleNotFoundError: No module named 'cv2'
    ". In the step where you set up the CMake configuration add this entry "BUILD_opencv_python3" type boolean and check it.

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Thank you!! I hope it'll help someone.

    • @siminesfshani8668
      @siminesfshani8668 3 роки тому

      Thank you. Where we should add it exactly? I have followed all the steps but still I get cv2 not found.

    • @dedenapraia
      @dedenapraia 3 роки тому

      @@siminesfshani8668 In Cmake, Before you hit configure, Cmake allows you to add entrys, so you add "BUILD_opencv_python3" and set it to TRUE, then after you hit configure you should see this included in the output:
      Python 3:
      Interpreter: C:/ProgramData/Anaconda3/python.exe (ver 3.8.5)
      Libraries: C:/ProgramData/Anaconda3/libs/python38.lib (ver 3.8.5)
      numpy: C:/ProgramData/Anaconda3/Lib/site-packages/numpy/core/include (ver )
      install path: C:/ProgramData/Anaconda3/Lib/site-packages/cv2/python-3.8
      Python (for build): C:/ProgramData/Anaconda3/python.exe
      ( This is MY configuration, you should have your own Path to your Python/Anaconda executables, make sure they are correct )

    • @siminesfshani8668
      @siminesfshani8668 3 роки тому

      @@dedenapraia thank you it really helped

    • @srinivasans6758
      @srinivasans6758 3 роки тому +1

      you are one of the person send by god 🙏

  • @ductin606
    @ductin606 2 роки тому +2

    finally i can install it, thank you very much, but the problem i have is not updating numpy before cmake

  • @gareth9330
    @gareth9330 2 роки тому

    Hey mate thanks a ton! It would definitely be worth ensuring people are aware of the requirement to download and add the zlib.dll to the environment path to ensure correct running of cuDNN otherwise it will throw cuda related errors when compiling. Its an easy fix but something noone mentions in their installation tutorials and leads to unneccessary issues. Thanks for the tutorial, keep up the good work!

  • @e101sg
    @e101sg 3 роки тому +1

    Dear all...It works! After 2 days, i can build OpenCV with CUDA support Excellent work. Thanks for the all the efforts.
    I am trying to build Darknet / Yolo4 on Windows 10. Any suggestion, how to proceed from here. If not mistaken, i can use the Anaconda base environment for the Darknet /Yolo4 as well. Cheers!

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Yes you can. There is another video on Darknet YOLOv4 which you can follow from here. You will need opencv_worldxxxx.dll file (where xxx is the version of openCV, 440 in this video or 451 in the case of 2021 video). So if you plan to build darknet, you should build opencv with opencv_world enabled (tick box) in CMake. After that, you can follow this video ua-cam.com/video/FE2GBeKuqpc/v-deo.html

  • @SimeonGreene
    @SimeonGreene 3 роки тому +4

    This took me about half a day to get right but I have to say your tutorial has been the best one I've found on this topic. There were a couple of issues that initially caused my setup not to work in anaconda:
    1. Early on during the first CMake configuration there was a numpy error. Specifically I had numpy 1.19.4 in my base installation and ran into this issue (stackoverflow.com/questions/64654805/how-do-you-fix-runtimeerror-package-fails-to-pass-a-sanity-check-for-numpy-an). I resolved it by uninstalling 1.19.4 and installing 1.19.3. You might need to reconfigure after doing this. In my case I already built everything before noticing so I had to start from scratch.
    2. After installing everything I tried to "import cv2 " in my base anaconda env and got this error:
    ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
    Couldn't find a good solution on the web but fortunately all I needed to do was open a new MiniConda shell env and then the import worked!
    Now I just needed to get this working in a separate environment. Unfortunately it seems that you can only compile for one python version. So if you have multiple conda environments with the same python version then no problem. But I had one conda env with python 3.8 and another with 3.7. Unfortunately I ended up having to build opencv separately for both environments. Wasn't pretty but at least now I have opencv with gpu working! Thanks a lot!

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Thank you for sharing the solutions to the most common problems.

    • @vantuongnguyen9405
      @vantuongnguyen9405 3 роки тому

      Hi @Simeon , Unfortunately, I have problem like you, "ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.", Could you help me clear all off step you have done to fix this, Thanks in advanced

  • @cklee2
    @cklee2 2 роки тому +1

    How come when i check cv2.getCudaEnabledDeviceCount() result is 0. how to set to 1?

  • @Patorik1899
    @Patorik1899 3 роки тому

    Very helpful, informative and straightforward video. Thank you!

  • @daniilmaltsev1325
    @daniilmaltsev1325 2 роки тому +2

    I'm very sorry. I followed guide. Everything was ok, finally, I built everything in VS as it was in the video, however, after that I tried to import cv2 and it tells that there is no such module

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Try the updated tutorial: ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @funwithpk2821
    @funwithpk2821 4 роки тому

    Worked without any errors. However, there were bunch of warnings during build process of Visual Studio. But still it's working fine. Thanks!

    • @TheCodingBug
      @TheCodingBug  4 роки тому

      I am glad I could help. Warnings are okay. Errors are not.

  • @AkdenAi
    @AkdenAi 2 місяці тому

    Hello, I did it without any er
    rors until the cmake compilation process, but after doing the ALLBUILD build in visual studio, it gives me an error. Can you help me?

  • @amitkotagi6265
    @amitkotagi6265 2 роки тому +1

    I built the opencv in directory F and python 38 is in C:/, and "i recieve ImportError: DLL load failed while importing cv2: The specified module could not be found." when try to import.
    I have tried rebuilding with numpy 1.19.5 version. How should i fix this? do i need to add path in environment variable?

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      You should try updated version of the tutorial. Perhaps you have not been able to tell CMake the path of your Python installation. This is made clear here:
      ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @rambled
    @rambled 3 роки тому +1

    Same problem with someone. Used clean anaconda(3.8.5) but failed, tried python3.8.5 instead and copy the stuff as someone suggested.

  • @minhdinh3814
    @minhdinh3814 3 роки тому +1

    On second configure
    Configuring incomplete, errors occurred!
    See also "C:/Opencv_built/build/CMakeFiles/CMakeOutput.log".
    See also "C:/Opencv_built/build/CMakeFiles/CMakeError.log".

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Try this updated tutorial. It uses alternative method to build opencv which is faster.
      ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @user-gb1ov8we8o
    @user-gb1ov8we8o 4 місяці тому

    When building is finiched ,I got 7 errors what should i do ? I need to colorize images and videos can i move forward or not ?

  • @25_26
    @25_26 2 роки тому +1

    Not working with cuda 10.2 cudnn 8, python 3.9, vs 2019 and opencv 4.53. Is it possible that you can compile python bindings and binaries for this system and share it here?

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Check my 2021 tutorial for openCV 4.5

  • @thesoulz5030
    @thesoulz5030 3 роки тому +1

    Please, add a similar video for LInux OS (Ubuntu 20.04 preferably). Thank you in advance, very good work so far! Thumbs up!

  • @cheatyruga7787
    @cheatyruga7787 8 місяців тому

    You are the best!

  • @dale5021a
    @dale5021a 28 днів тому

    Hello, I use the same graphics card ,and I installed CUDA-9.2 lastly in Windows 10. At cmake’s Configure and Generate step, all is fine and working well.
    But when I tried to build OpenCV-4.2.0 with CUDA in Visual Studio 2015, it take many errors about CUDA. I am trying to solve these problems and check all step for many times but no use. Is that CUDA-9.2 is compatible with OpenCV-4.2.0?

  • @deepmodi9354
    @deepmodi9354 3 роки тому +1

    Great Tutorial, Thanks.

  • @hemantchaudhary3465
    @hemantchaudhary3465 3 роки тому +4

    Hey i followed the installation very well till the end with zero errors or issues, but after i build the install part, i saw only 1 successful instead of 2 as shown in the video. when in anaconda prompt i am not able to import cv2. The error states no module named cv2. I have done this installation multiple times and i dont know what the issue is

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Here are possible reasons.
      You have virtual environment of Python.
      You have multiple Python versions installed.
      There should be a file inside your build/lib/python3/Release folder called cv2.cp38-win_amd64.pyd .... Copy that in your site-packages folder of Anaconda3.

  • @kaandemiray9291
    @kaandemiray9291 3 роки тому

    It worked. Thank you so much sir.

  • @sefadogan4795
    @sefadogan4795 2 роки тому +1

    I installed OpenCV as in the video. But I can't import cv2. I am getting an error. The error is as follows:
    >>> import cv2
    Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'
    Can you help me?

    • @TheCodingBug
      @TheCodingBug  2 роки тому +1

      You can follow the updated video ua-cam.com/video/YsmhKar8oOc/v-deo.html

    • @sefadogan4795
      @sefadogan4795 2 роки тому

      @@TheCodingBug Thank you for your answer. I will try it

  • @DevilErnest
    @DevilErnest 3 роки тому

    Thank you. I made sure I have tested it before giving the like and subscribe LOL

  • @rsalazar9784
    @rsalazar9784 3 роки тому

    Gracias todo esta perfecto. Se recomienda PRIMERO: eliminar python, anaconda, Visual Studio, y luego instalar todo NUEVO: Anaconda y Visual Studio. Verificar las rutas.

    • @dedenapraia
      @dedenapraia 3 роки тому

      Hola Rudy, como haces para hacer funcionar CV2 con Anaconda ? Ya intente settear el Python Path en CMake pero no tengo exito, algun tip ? Gracias de antemano

    • @rsalazar9784
      @rsalazar9784 3 роки тому

      @@dedenapraia Coloca el PATH de Anaconda, no de Python.

  • @saidanianis1923
    @saidanianis1923 3 роки тому +1

    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'
    how to fix this

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Try this updated tutorial: ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @arnoldrivera3288
    @arnoldrivera3288 3 роки тому +1

    after following it all, when I check the import cv2 on anaconda it says Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'
    Theres no error on the VS, what did I miss?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      The issue is addressed in this updated video ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @austossen
    @austossen 6 місяців тому

    hi, when i build the sln file ALL_BUILD i get two types of errors (windows 11/opencv4.5.5/opencv-contrib4.5.5/vs2022):
    -- error codes --
    (1) C1356 unable to find mspdbcore.dll libpng
    (2) C1060 compiler is out of heap space opencv_test_core_AVX
    (3) LNK1181 cannot open input file '..\..\lib\Release\opencv_phase_unwrapping455.lib'
    (4) C1076 compiler limit: internal heap limit reached opencv_gapi
    (5) C3859 Failed to create virtual memory for PCH opencv_videoio
    -- warning codes --
    (1) #1394-D field of class type without a DLL interface used in a class with a DLL opencv_cudaarithm
    (2) #1388-D base class dllexport/dllimport specification differs from that of the derived class opencv_cudaarithm
    (3) C4505 'cv::cudev::atomicAdd': unreferenced function with internal linkage has been removed opencv_cudaarithm
    (4) C4267 '=': conversion from 'size_t' to 'int', possible loss of data opencv_core
    (5) LNK4098 defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library opencv_core
    (6) #1215-D function "tex2D(texture, float, float) [with T=float]" opencv_cudawarping
    (7) C4996 'cudaBindTexture2D': was declared deprecated opencv_cudawarping
    (8) C4805 '|': unsafe mix of type 'int' and type 'bool' in operation opencv_dnn
    (9) C4244 'argument': conversion from 'uint' to 'const unsigned char' opencv_cudastereo
    (10) C4244 '=': conversion from 'const _Ty' to 'float', possible loss of data opencv_cudaarithm
    (11) C4189 'ITEMS_PER_THREAD': local variable is initialized but not referenced opencv_dnn
    Total ERRORS: 147
    Total WARNINGS: 2947
    ERRORS:
    58>LINK : fatal error LNK1181: cannot open input file '..\..\lib\Release\opencv_imgproc455.lib'
    58>Done building project "opencv_features2d.vcxproj" -- FAILED.
    78>please visit aka.ms/pch-help for more details
    78>C:\Users\austo\OneDrive\Desktop\pycuda_gpu\opencv-4.5.5\modules\gapi\src\backends\common\gcompoundbackend.cpp(1,1): error C1076: compiler limit: internal heap limit reached
    78>(compiling source file '../../../opencv-4.5.5/modules/gapi/src/backends/common/gcompoundbackend.cpp')
    78>C:\Users\austo\OneDrive\Desktop\pycuda_gpu\opencv-4.5.5\modules\gapi\src\api\s11n.cpp(1,1): error C3859: Failed to create virtual memory for PCH
    78>(compiling source file '../../../opencv-4.5.5/modules/gapi/src/api/s11n.cpp')
    78>C:\Users\austo\OneDrive\Desktop\pycuda_gpu\opencv-4.5.5\modules\gapi\src\api\s11n.cpp(1,1):
    78>PCH: Unable to commit memory across file map
    78>C:\Users\austo\OneDrive\Desktop\pycuda_gpu\opencv-4.5.5\modules\gapi\src\api\s11n.cpp(1,1):
    78>please visit aka.ms/pch-help for more details
    build output tail:
    197>------ Build started: Project: opencv_perf_cudafeatures2d, Configuration: Release x64 ------
    198>------ Build started: Project: opencv_perf_cudacodec, Configuration: Release x64 ------
    197>A task was canceled.
    197>A task was canceled.
    198>A task was canceled.
    198>A task was canceled.
    199>------ Build started: Project: opencv_perf_cudabgsegm, Configuration: Release x64 ------
    200>------ Build started: Project: opencv_perf_cudaarithm, Configuration: Release x64 ------
    199>A task was canceled.
    199>A task was canceled.
    200>A task was canceled.
    200>A task was canceled.
    201>------ Build started: Project: opencv_perf_core, Configuration: Release x64 ------
    202>------ Build started: Project: opencv_perf_calib3d, Configuration: Release x64 ------
    201>A task was canceled.
    201>A task was canceled.
    202>A task was canceled.
    202>A task was canceled.
    203>------ Build started: Project: opencv_perf_bioinspired, Configuration: Release x64 ------
    203>A task was canceled.
    203>A task was canceled.
    204>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
    204>A task was canceled.
    204>A task was canceled.
    ========== Build: 42 succeeded, 162 failed, 0 up-to-date, 0 skipped ==========
    ========== Build completed at 9:26 PM and took 24:34.245 minutes ==========

  • @JoonhwanLee
    @JoonhwanLee 3 роки тому

    coool thanks for this vid! you make my day!!!!

  • @wonderavantakam
    @wonderavantakam 3 роки тому +1

    bro i am having tensorflow in other environment but this has installed on base how to activate this to my tensorflow environment please guide me

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      You will need to build for virtual environment again. You need to set all the paths to python3 directories in Cmake to point the virtual environment (which are by default set to base environment).

  • @nugratasik4137
    @nugratasik4137 11 місяців тому

    Hey I have a problem with the cmake build, after activating the BUILD_opencv_world, my visual studio can not find the lib/Release/opencv_world480.lib file.. I'm using cuda 12, cudnn 8.9, opencv 4.8 and opencv contrib 4.8

    • @nugratasik4137
      @nugratasik4137 11 місяців тому

      I've tried using the 4.7 version of opencv and contrib, it still not build the opencv_world file in build/lib/Release directory

  • @awdhootkanawade
    @awdhootkanawade 3 роки тому +1

    followed exactly but got 39 success and 153 failed in vs 2017 please help

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      It does not work on VS 2017. Also, try this updated tutorial for OpenCV 4.5.1. ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @mlnima
    @mlnima 2 місяці тому

    mine took 5.1 sec to generate 🤔🤔

  • @chiragkaushik2057
    @chiragkaushik2057 3 роки тому +1

    i am getting this error please help
    Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) (Required is at least version "7.5")

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Hi. You need to install right version of CUDA and cuDNN.

  • @ParabellumHistory
    @ParabellumHistory 3 роки тому +1

    ModuleNotFoundError: No module named 'cv2'
    The build and installation showed no errors :/

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Try this updated method: ua-cam.com/video/YsmhKar8oOc/v-deo.html

    • @ParabellumHistory
      @ParabellumHistory 3 роки тому

      @@TheCodingBug Thanks, it worked!

  • @mallvin2000
    @mallvin2000 3 роки тому +1

    When i try and build in VS code 2019, the build will fail and say that visual studio 2019 is not support. Did you have this issue?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I didn't get this error. You can check the updated tutorial for OpenCV build here ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @HiepNguyen-gq5lp
    @HiepNguyen-gq5lp 3 роки тому

    thank you so much. i did it!

  • @andrespereira4852
    @andrespereira4852 3 роки тому +1

    I could compile OpenCV in VS 2017 without warnings or errorsconfigured for CUDA 10.0, cuDNN 7.6.5(Nvidia GTX 1070), on Python 3.8, and added an ENTRY BUILD_opencv_python3 and checked it before compiling in CMake without any errors.
    Tried 2 time to install same CUDA and cuDNN as yours but crashes
    In ALL BUILD compilation I get Build: 188 succeeded, but with INSTALL I only get 1 succeed and anaconda prompt does not recognize opencv. Watched 2 videos about compiling custom OpenCV and both show 2 succeed. What the heck is wrong?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      I am not sure. Perhaps an updated tutorial is needed that addresses all the issues reported in the comments.

    • @luiscao7241
      @luiscao7241 3 роки тому

      me too, only 1 succeed!

  • @bektinurwanto
    @bektinurwanto 3 роки тому

    hi sir, i have problem to install. where i must install location for python??

  • @florian-radu
    @florian-radu 3 роки тому

    this is the worst thing i have installed in years. the module can't be found tryed all the answer here and above, i tried remove all my python version, then remove all my system variables, the build have no errors, when i compile in the visual studio. this is imposible and sad

  • @yusufucan383
    @yusufucan383 3 роки тому +1

    Hello, I successfully installed and builded everything. I can get same output when write cv2.cuda.getCudaEnabledDeviceCount() on command panel. But how can I use this command a .py file. When I try to use, I am getting error.

  • @linjake2227
    @linjake2227 3 роки тому +1

    I run ALL_BUILD and it shows this error "LNK1104: cannot open file 'python38_d.lib'"

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Hi. You can try alternative method. ua-cam.com/video/YsmhKar8oOc/v-deo.html

    • @linjake2227
      @linjake2227 3 роки тому

      @@TheCodingBug Success run, thx.

  • @johncaling6150
    @johncaling6150 3 роки тому

    Hi sir when building I get linking error "LNK1181 can't find input file \lib\Release\opencv_core440.lib". This error also happens but with different .lib files such as opencv_flann440.lib, opencv_imageproc440.lib, etc. I don't get any errors during the Configuring or Generating process. How do I fix this?

  • @SuperLittle35
    @SuperLittle35 3 роки тому

    Where are the links?

  • @sujaykadam99
    @sujaykadam99 3 роки тому +2

    Everything good till 5:50 but after I point it to modules dir it and click configure it does not give more options any possible fix?

    • @sujaykadam99
      @sujaykadam99 3 роки тому +1

      just remove the text from search tab it fixes it

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I am glade its fixed.

  • @g4laxy551
    @g4laxy551 3 роки тому

    when I try to import cv2 i get the error:
    ImportError: OpenCV loader: missing configuration file: ['config-3.8.py', 'config-3.py']. Check OpenCV installation.
    Any idea how to fix this?

  • @nithinprincejohn7762
    @nithinprincejohn7762 3 роки тому +2

    Whether we need to add python development workload in visual studio 2019 during the installation process?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      No that is not required. Only check the options which I have checked.

    • @nithinprincejohn7762
      @nithinprincejohn7762 3 роки тому

      @@TheCodingBug tnks for d reply

  • @helloankur2009
    @helloankur2009 3 роки тому +1

    how I detect face by using opencv+cuda? need your help

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I will be making a video tutorial about that. Stay tuned!

  • @fatihfuad1909
    @fatihfuad1909 3 роки тому +1

    hi, it worked for me thank you, but can i know what happened if i delete the " build " folder after everything is done? I still can use cv2 module or not?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I am glad it helped. You can delete everything in the build folder except "lib" directory.

  • @ArunKumar-sg6jf
    @ArunKumar-sg6jf 3 роки тому

    ii have error on undefined refrefernce function on opencv cuda build can u give any idea to solve thsi

  • @aykutsirma4260
    @aykutsirma4260 3 роки тому +1

    For OpenCV 4.5 which cuda and cudnn versions do I need? and How can I activate the opencv gpu for python too? thank you.

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I have separate video for opencv 4.5.1 ua-cam.com/video/YsmhKar8oOc/v-deo.html
      It also covers the installation for virtual environment of Python.

  • @nhatlequang5475
    @nhatlequang5475 3 роки тому

    My laptop have 2 graphic card ( intel, nvidia gpu) , i setup opencv like your video but when i run a project , it's auto run with intel gpu, how can i run with nvidia gpu?

  • @adarshgouda847
    @adarshgouda847 3 роки тому +1

    all went well with no errors... but when i import cv2 in conda it does not find the opencv module... is there a wat to link the build installed in another driveto anaconda base environment? somehow the opencv is not linking with the anaconda library...

    • @sudarshanpaul9330
      @sudarshanpaul9330 3 роки тому +1

      Where you able to fix the issue? I am facing the same

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      If everything builds fine without any error and you still get "Module Not Found" error, You need to update numpy to latest version and then clear cache in Cmake by going to file >> delete cache. Then build everything again and it will work.

  • @gabrielasolano922
    @gabrielasolano922 3 роки тому +1

    Excelent! :D

  • @NovaratS
    @NovaratS 3 роки тому +1

    Great video!!! But I am facing a problem here: my build folder is missing the .sln file along with many others. I don't understand what I did wrong, could you please help me with this?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      You can try updated video with a different method. ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @aqiff123
    @aqiff123 3 роки тому +1

    I have DLL module problem now.
    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python38\lib\site-packages\cv2\__init__.py", line 96, in
    bootstrap()
    File "C:\Python38\lib\site-packages\cv2\__init__.py", line 86, in bootstrap
    import cv2
    ImportError: DLL load failed while importing cv2: The specified module could not be found.

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      It seems one or more modules of opencv didn't compile right. Are you sure there were no errors during build?

    • @aqiff123
      @aqiff123 3 роки тому +1

      Its okay, everything has solved

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      I am glad it is resolved. For future readers, you can share the solution. Maybe it'll help someone.

    • @mdiftekherhossain6152
      @mdiftekherhossain6152 3 роки тому

      how did you solve the problem?

    • @aqiff123
      @aqiff123 3 роки тому +1

      Iftekher Hossain im not sure how and why. But what I did was: uninstall my previous python (3.7.5) and install to (3.7.9). You also need to check the path of its download. Dont store it at AppData/local. Instead create new folder “Python37” at C:// or anything. Then after you installed your python, then you can proceed with this tutorial

  • @DrFlox
    @DrFlox 3 роки тому +1

    Thanks. the explanations were great... but in the last step I still got 131 errors :( FML

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Try this updated method.
      ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @ahuman5383
    @ahuman5383 2 роки тому +1

    can i delete the opencv file after built?

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      I have covered the cleaning process in my 2021 updated video: ua-cam.com/video/YsmhKar8oOc/v-deo.html

    • @ahuman5383
      @ahuman5383 2 роки тому +1

      @@TheCodingBug wah I didn't expect such fast reply from you. Thank you sir, I will check it out

  • @rsalazar9784
    @rsalazar9784 3 роки тому

    Por favor, muestre todas las banderas / selecciones y caminos indicadas en el CMake de su instalación. Gracias.

  • @Tuncaycortez
    @Tuncaycortez 2 роки тому +1

    What is your cudnn version?

    • @TheCodingBug
      @TheCodingBug  2 роки тому +1

      It's shown in the video.
      You can try the updated tutorial for it ua-cam.com/video/YsmhKar8oOc/v-deo.html

  • @nitinkumar29
    @nitinkumar29 3 роки тому +1

    I think, python path issues should be addressed in the video which can be quite difficult for beginners.

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I agree. But it's straight forward if we install Python with Anaconda.

    • @nitinkumar29
      @nitinkumar29 3 роки тому +1

      @@TheCodingBug I think, confusion is because Anaconda is not mentioned in the videos title or in description or even the first screen frame.

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      After people complained about Python paths, I mentioned in description that I am using Anaconda with Python 3.8.

    • @nitinkumar29
      @nitinkumar29 3 роки тому

      @@TheCodingBug I missed to check that part, yes setting path for python is not easy. I finally could able to compile all without error and with python after few attempt. I gave thumps up to this video as I also learned from this video, it is a short and crisp video to setup the opencv without fuss.

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      I am glad I could help.

  • @BdyPhrk
    @BdyPhrk 3 роки тому

    Big thanks!

  • @muhammedakyuzlu6317
    @muhammedakyuzlu6317 3 роки тому

    @TheCodingBug Hi. thanks for the video .
    when I follow the steps it got work on conda base env can I copy it to another env or do i need to rebuild it from scratch with new env python path ?

  • @-yaseenabdulwali4392
    @-yaseenabdulwali4392 3 роки тому +1

    What if i only have amd GPU, is there any other way?

  • @abdullahaygun4000
    @abdullahaygun4000 3 роки тому +1

    I have a problem after installing the OpenCV.sln and anaconda cmd write "import cv2" where it says
    Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'
    Please help me!

    • @dedenapraia
      @dedenapraia 3 роки тому

      Dude, add this to your Cmake configuration and try again "BUILD_opencv_python3" and set its value to True (Checkbox), I spend a whole day trying to make this work. Good luck !

    • @andrespereira4852
      @andrespereira4852 3 роки тому +1

      @@dedenapraia I have same problem, I added that new entry in CMake and still getting same result

    • @luiscao7241
      @luiscao7241 3 роки тому +1

      I have the same problem, please help to tell me a solution

    • @dedenapraia
      @dedenapraia 3 роки тому

      In Cmake when you hit Configure, after the process is done, there is an Output right ? This output should have something like this (Depending on your paths to python or if you are using Anaconda) :
      Python 3:
      Interpreter: C:/ProgramData/Anaconda3/python.exe (ver 3.8.5)
      Libraries: C:/ProgramData/Anaconda3/libs/python38.lib (ver 3.8.5)
      numpy: C:/ProgramData/Anaconda3/Lib/site-packages/numpy/core/include (ver )
      install path: C:/ProgramData/Anaconda3/Lib/site-packages/cv2/python-3.8
      Python (for build): C:/ProgramData/Anaconda3/python.exe

    • @luiscao7241
      @luiscao7241 3 роки тому +1

      @@dedenapraia maybe my path to python and anaconda are wrong. Currently it is NOT in ProgramData, but
      C:\Users\caomi\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.8

  • @helloankur2009
    @helloankur2009 3 роки тому +1

    After complete all step. How to use that build in pycharm from virtual environment ?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      For a virtual environment, you have to set python3 paths to the virtual environment (all of them). Then compile it again.

    • @helloankur2009
      @helloankur2009 3 роки тому +1

      @@TheCodingBug thanks. can you give me some link or demo where to set path ?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      @@helloankur2009 In CMake GUI, search for PYTHON3_
      and you will see a bunch of paths, which are set to base Anaconda3 directories. You need to set all of them to virtual environment directories. For example:
      PYTHON3_EXECUTABLE is set to C:\USsers\Anaconda3\python.exe
      It will become C:\Users\Anaconda3\env\myVirtualEnv\python.exe
      and same goes for all other PYTHON3_ paths.
      If it does not work, I will be posting an updated tutorial next week with all the configurations in a script. Which will be easier to setup.

    • @helloankur2009
      @helloankur2009 3 роки тому

      @@TheCodingBug Hi I am able to use in pycharm by the base interpreter from c:\User\\...\\..\\. Thanks for your help and support.. can you share some code on how to use cv2 with Cuda to open image and video?

  • @thatHandsomeGeek
    @thatHandsomeGeek 3 роки тому

    My graphics card 940mx is not there on wikipedia page of cuda so what should I write at cuda arch bin in cmake????

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      This card is not supported.

    • @thatHandsomeGeek
      @thatHandsomeGeek 3 роки тому

      @@TheCodingBug Actually I checked everything on the web and it shows it supports cuda with compute capacity of 5.0 but after I did all the things it showed around 200 errors in Visual Studio will building all build and most of the errors were with linker showing unable to open file and sometimes unable to detect file. This was through LNK1181. Any suggestions???

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      @@thatHandsomeGeek you can try updated method for building opencv (2021) that I've posted.
      I am unable to verify for this GPU as I do not have access to yhis GPU.

  • @pavitrashah
    @pavitrashah 3 роки тому

    everything was successfully build and installed but it's still not using cuda.

    • @miroslavgechev4852
      @miroslavgechev4852 3 роки тому

      Did you manage to solve the problem ? Opencv was installed for me, I can import the module in python, but it is still using CPU.

  • @aqiff123
    @aqiff123 3 роки тому +1

    I have some problems after installing the OpenCV.sln, where it says
    Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Are you installing it in virtual environment?

    • @aqiff123
      @aqiff123 3 роки тому +1

      @@TheCodingBug no, not in the virtual environment

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      In that case, make sure that CMake was able to successfully detect paths for python3.

    • @aqiff123
      @aqiff123 3 роки тому

      TheCodingBug how can i do that??

    • @aqiff123
      @aqiff123 3 роки тому

      TheCodingBug my python version for anaconda is 3.8 while the basic one is not 3.7

  • @nolfred98
    @nolfred98 3 роки тому

    I get "Error in configuration process, project files may be infalid" from CMake when i click Configure for the second time, after setting extra module path to opencv_contrib...
    I've tried both OpenCV 4.4.0 and 4.5.0 and i keep getting this error.

    • @omarfaruk5695
      @omarfaruk5695 3 роки тому

      I got the same error. Have you solved it?

    • @GigaChadGladiator
      @GigaChadGladiator 3 роки тому

      install cudnn correctly, that fixed it for me

  • @ritamchakrabarty5325
    @ritamchakrabarty5325 3 роки тому

    I am using Windows 10, and my cmake-gui crashes every time when I select the module directory for OPENCV_EXTRA_mODULES_PATH. How to solve this issue?

    • @miroslavgechev4852
      @miroslavgechev4852 3 роки тому

      Don't click on the select path button, instead entering the path manually in the value field worked for me.

    • @ritamchakrabarty5325
      @ritamchakrabarty5325 3 роки тому

      @@miroslavgechev4852 Using your method, my cmake has stopped crashing, but now I am getting this error:
      Configuring incomplete, errors occurred!
      See also "D:/yolo/build/CMakeFiles/CMakeOutput.log".
      See also "D:/yolo/build/CMakeFiles/CMakeError.log".

  • @ozlematz2528
    @ozlematz2528 2 роки тому

    Hello i dont have to nvidia geforce gtx 1016. What can i do?? Help please

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Do you have any other model of nvidia GPU?

    • @ozlematz2528
      @ozlematz2528 2 роки тому

      @@TheCodingBug i have Jetson nano and Jetson xavier

    • @TheCodingBug
      @TheCodingBug  2 роки тому +1

      @@ozlematz2528 I am not sure about Jetson nano.

    • @ozlematz2528
      @ozlematz2528 2 роки тому

      @@TheCodingBug Ok .Thank :))

  • @mdiftekherhossain6152
    @mdiftekherhossain6152 3 роки тому +1

    Do you have any idea why this error occurs? Thanks in advance.
    raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
    ImportError: OpenCV loader: missing configuration file: ['config-3.7.py', 'config-3.py']. Check OpenCV installation.

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Your site-packages/cv2 does not have config-3.7.py file. Either you have multiple Python versions or there is the wrong file at that location (maybe config-3.6.py)

    • @mdiftekherhossain6152
      @mdiftekherhossain6152 3 роки тому

      would you please suggest me how can I resolve this problem?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      @@mdiftekherhossain6152 If you have native python, only install one version (Probably Python 3.8). Uninstall all other versions. Alternatively, you can install Anaconda with Python 3.8 and reinstall OpenCV. Anaconda is always a convenient way to install Python.

    • @mdiftekherhossain6152
      @mdiftekherhossain6152 3 роки тому

      yes. I have native python and initially, cmake path was that. I have changed all the paths to the anaconda path. will uninstalling native python help to get rid of the error? Thanks for your suggestion

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      @@mdiftekherhossain6152 No. You will have to build OpenCV for one environment (either native or Anaconda). You will have to build it again and carefully check which version CMake picks up in PYTHON3_EXECUTABLE etc.

  • @namle-fm5en
    @namle-fm5en 3 роки тому

    If buid "BUILD_ALL", this is also install opencv with GPU for anaconda, python ?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Yes it would. Infact, I am using Anaconda python in this tutorial.

  • @aayushlakhani2073
    @aayushlakhani2073 3 роки тому +1

    Hey, it's not working in conda virtual env, can u help pls ?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Hi. The installation of OpenCV from source is equivalent to installing using pip in a way that for every virtual environment (VE), you activate the VE, and then do pip install for that particular environment. Similarly, to build a package from source and installing it to VE requires that we set the right paths for CMake. For system wide installation, notice the options in CMAKE starting with PYTHON3. They all are pointed to the system wide directories. You need to point them to corresponding VE directories. Following is an example:
      PYTHON3_EXECUTABLE=~/.envs/myenv/bin/python.exe
      PYTHON3_INCLUDE_DIR=~/.envs/myenv/bin/python/include
      Hope that it will solve the problem. If not, comment down below and I will make a tutorial on how to build it for VE.

    • @aayushlakhani2073
      @aayushlakhani2073 3 роки тому

      @@TheCodingBug thanks, it solved the problem but I had to rebuild

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I am glad issue is resolved.

    • @sumittanpure2141
      @sumittanpure2141 3 роки тому +1

      @@TheCodingBug can i apply the same method for env created via virtualenv or having a conda evn is compulsory?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      You can do this for any environment. Just make sure that CMake picks up paths for Python3 correctly (all paths including site_packages, python.exe etc). If it does not, You will have to manually define them. Otherwise, it will return "Module not found" error when you will import it to Python.

  • @nguyenvu6371
    @nguyenvu6371 3 роки тому

    Thanks for your turtorial. I have a problem. How to make Pycharm IDE regconize this rebuild opencv module?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      Its been long since I abandoned PyCharm so I am not sure how this can be done because as far as I can remember, PyCharm had its own repository to install from (somewhere in the project setting).

    • @g4laxy551
      @g4laxy551 3 роки тому +1

      Add the path to the cv2 directory to your PYTHONPATH system variable. That should help.

    • @nguyenvu6371
      @nguyenvu6371 3 роки тому

      @@g4laxy551 thanks mate

  • @khaledjbaili8654
    @khaledjbaili8654 3 роки тому +1

    Thanks for the turotial. Ive followed the steps and everything went successfully (no errors during the build process). However, when i´ve checked the opencv through import cv2 in the base environment in anaconda, it returned the error ( ModuleNotFoundError: No module named 'cv2'). So what could the problem be?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      You need to update your numpy installation before making OpenCV. Use command
      pip install --upgrade numpy

    • @khaledjbaili8654
      @khaledjbaili8654 3 роки тому

      @@TheCodingBug thanks for the reply. however, it didnt work. Besides I dont understand what does upgrading numpy have to do with cv2 ?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      @@khaledjbaili8654 You need to upgrade numpy as then build again. During CMake build, the message is printed at the end showing for which python version the build would be installed. If you do not see this message, you will not get python bindings.
      Numpy is used during creation of python bindings. If its outdated version, it will not going to work.

    • @khaledjbaili8654
      @khaledjbaili8654 3 роки тому

      @@TheCodingBug okay i will rebuild again. do i have to rebuild starting from the begining (from cmake) or from visual studio?. Just want be sure that every thing is done as it should be. Ive placed the build file in Disk E:\OPENCV_CUDA, while the default path of the kernel (base) of anaconda as i open it, is (base) C:\Users\engjb>. should the build be in the same path or it doesnt matter

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      @@khaledjbaili8654 Rebuild from cmake. First go to File and clear Cache. Then rebuild all configurations from cmake. Then form visual studio.

  • @notreg6272
    @notreg6272 3 роки тому

    Hi, you are my last hope, I am using OpenCV 4.4.0 with numpy 1.20.0, trying to bind tensorflow version 2.4.0 and it gives me an error (NotImplementedError: Cannot convert a symbolic Tensor (random_zoom/zoom_matrix/strided_slice:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported), but it also works fine on numpy version 1.19.2, but from this version CV2 crashes with an error (RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd). Please tell me what could be the problem?
    python 3.8.5

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      You should try the latest opencv with TF2.4 or try to build TF2.3.1 instead.

    • @notreg6272
      @notreg6272 3 роки тому

      @@TheCodingBug thanks, I'll try

    • @notreg6272
      @notreg6272 3 роки тому

      @@TheCodingBug I apologize for the importunity, but please tell me, I started to give out a similar error "print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
      AttributeError: module 'tensorflow' has no attribute 'config'"

  • @deepmodi9354
    @deepmodi9354 3 роки тому +1

    If you are installing cuda for GPU or following this video ( ua-cam.com/video/FE2GBeKuqpc/v-deo.html ) for the yolov4 don't forgot to select BUILD_opencv_world during the CMAKE process otherwise you will be in trouble during the Darknet installation.
    If you find this comment helpful then please pin it. or if I am wrong please let me know I will remove this comment. So that it will not create any confusion.
    Thank You.

  • @saber3747
    @saber3747 3 роки тому

    I have cuda 10.0 installed in my anacodna environment, will it affect my anacodna environment if I go back to the website and download cuda 10.1.2?

    • @TheCodingBug
      @TheCodingBug  3 роки тому +1

      You can install multiple versions of CUDA. However, only one will be added to PATH variable of the the system.

    • @saber3747
      @saber3747 3 роки тому

      @@TheCodingBug python 3.8's tensorflow-gpu cannot connect to a GPU by CUDA, which means I can only use OPENCV to connect to a GPU?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      @@saber3747 TensorFlow needs compatible version of CUDA qnd cuDNN. you can inatall TensorFlow GPU in a separate environment along with supported CUDA amd cuDNN. Here's how to do it. ua-cam.com/video/toJe8ZbFhEc/v-deo.html

    • @saber3747
      @saber3747 3 роки тому

      @@TheCodingBug good, thank you.

  • @siminesfshani8668
    @siminesfshani8668 3 роки тому

    Thank you for your video. I have followed every steps in the video but still I get no module found when trying to import cv2. Do you know how I can fix it? Please help

    • @luiscao7241
      @luiscao7241 3 роки тому

      same issue

    • @siminesfshani8668
      @siminesfshani8668 3 роки тому

      @@luiscao7241 I managed to fix that by setting the directory for python libraries. I found this solution among the comments in the video. Here is the link screenshot of the comment:
      www.dropbox.com/s/96e3rg61tkorg2n/Photo%202021-01-10%2C%2012%2036%2055%20AM.png?dl=0

    • @siminesfshani8668
      @siminesfshani8668 3 роки тому

      You only need to set the python3 lines when doing configuration using cmake

    • @luiscao7241
      @luiscao7241 3 роки тому

      @@siminesfshani8668 you are right. Thank you

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      If everything builds fine without any error and you still get "Module Not Found" error, You need to update numpy to latest version and then clear cache in Cmake by going to file >> delete cache. Then build everything again and it will work.

  • @darthplumbus4263
    @darthplumbus4263 3 роки тому

    Is Anaconda necessary? Can’t I use only python?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      You can use native Python as well. Just make sure CMake picks up the paths correctly (and it will if Python is added to PATH variable).

  • @matsbuscher8255
    @matsbuscher8255 3 роки тому

    Why not just press Open Project at 6:50?

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Sometimes it does not open with administrator rights so the build process can throw an error. So using the command prompt as Administrator ensures that the project file will be opened as Administrator.

    • @matsbuscher8255
      @matsbuscher8255 3 роки тому

      That’s right. That’s why I have my VS set up to open as admin.

  • @sesgiog
    @sesgiog 3 роки тому

    Hi man, thanks a lot for the tutorial, really appreciated, I am new to building things with CMake so I don't have much experience, but when I click on Configure for the second time it gives me errors, that I don't know how to solve...
    If you want I can send you the error.log file

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      Hi. You can create an "issue" on the GitHub link I shared in the description and paste the error there. I will look into this.

    • @sesgiog
      @sesgiog 3 роки тому +1

      @@TheCodingBug I solved, didn't install cuDNN correctly...thanks anyways!

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      No worries. I am glad that the problem is resolved.

    • @sesgiog
      @sesgiog 3 роки тому +1

      @@TheCodingBug Sorry if I bother you too much, but now I have another error. After compiling the ALL_Build thing and then INSTALL, and all went perfectly, but if I try to import the library on Python it won't let me...

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      No problem. I hope you are using Anaconda because that makes the whole process easier. But if you are using native python, make sure that CMake GUI picks up python 2/3 paths after you hit Configure for the first time. If it is not picking python paths, you will have to add it manually.
      If I have understood the problem rightly, this will solve the problem. If you can share the error, may be I will be in a better position to help.

  • @dompower500
    @dompower500 3 роки тому

    Hi Codebug. You are excellent. Your videos are very easy to understand. I could successfully install the opencv-gpu in my laptop (it has GTX1070)
    I have a question. After compiling opencv gpu version, my anaconda or pycharm is unable to detect the compiled version.
    example: my build path is D:\opencv\build .
    when I use windows cmd CLI, and python the following command prints 1.
    import cv2
    count = cv2.cuda.getCudaEnabledDeviceCount()
    print(count)
    but If try the same comand inside anoconda CLI or pycharm the print brings 0.
    Pls explain sir, after the successful compiling of opencv-gpu version, how to integrate (import) in anoconda or pycharm?
    thank you. my email id is dompower at gmail.com

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      It looks like you have multiple versions of Python installed (Anaconda and Native). During CMake build process, CMake automatically detects the python3 paths (including python.exe, site_packages etc). OpenCV will be installed for these python versions only. If it is picking up Anaconda paths, it will work with Anaconda Prompt. But if it is picking up Native python3 paths, it will work with windows CMD.
      Regarding PyCharm, I have never used it with custom build OpenCV. As far as I can recall, PyCharm has its own repository, which has pre-built OpenCV. But I am not sure how to integrate custom build to it.

    • @dompower500
      @dompower500 3 роки тому

      @@TheCodingBug thanks for your solution. Would you pls guide me how can I uninstall the native python version? I strongly believe it is installed part of pycharm installation...

    • @dompower500
      @dompower500 3 роки тому

      @@TheCodingBug Thank you very much sir. You are right. There are two versions of python. OpenCV-GPU ( i mean built from source as per your guidelines) was built for native python version. That's good. Bcs when I reinstalled pyCharm, it recognized native python and opencv-gpu (built from source) and everything is ok now. thanks you.

  • @techbuildspcs
    @techbuildspcs 3 роки тому +1

    Wasted hours on this. Vc throws about 171 errors. Python is fucking garbage on windows. My god.

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      I am sorry to hear that. But if you use exactly same versions of everything as mine, you will be able to successfully build it. There are newer versions of Python, OpenCV, and CUDA since I made this tutorial and those might not work well with same configurations.

    • @techbuildspcs
      @techbuildspcs 3 роки тому

      @@TheCodingBug Thats what i did though, figured that was an issue and reverted back to the same versions. Vc even throws errors saying vc 2017 is needed for no reason.

    • @techbuildspcs
      @techbuildspcs 3 роки тому

      @@TheCodingBug VC 2019 is the issue, for some reason it seems to be very unstable. Im going to run VC 2017 from now on. Its workign perfectly even with regular python!

    • @TheCodingBug
      @TheCodingBug  3 роки тому

      @@techbuildspcs Thats new for me!! I hope someone else having same issue finds this information useful.

    • @techbuildspcs
      @techbuildspcs 3 роки тому

      @@TheCodingBug yep Microsoft even locked vs 2017 behind logins so I'm keeping my copy held tight. I hope so too. Might make an updated tutorial showing how I did it with regular python for the path issues.

  • @has4053
    @has4053 Рік тому

    Hi.. I got error when building ALL_BUILD in visual studio. The error message was as follows
    error LNK2019: unresolved external symbol "public: __cdecl cv::cudacodec::EncoderParams::EncoderParams(void)" (??0EncoderParams@cudacodec@cv@@QEAA@XZ) referenced in function "struct _object * __cdecl pyopencv_cv_cudacodec_createVideoWriter(struct _object *,struct _object *,struct _object *)" (?pyopencv_cv_cudacodec_createVideoWriter@@YAPEAU_object@@PEAU1@00@Z)
    can anyone help me pls? Thanks in advance
    @TheCodingBug

    • @has4053
      @has4053 Рік тому

      I'm currently using nvidia rtx 3060..
      installed cuda 11.7
      visual studio 2022
      opencv 4.6.0

    • @ammar46
      @ammar46 11 місяців тому

      Try with VS 2019