Quick and Easy OpenCV Python Installation with Cuda GPU in Under 10 Minutes

Поділитися
Вставка
  • Опубліковано 20 сер 2024
  • Inside my school and program, I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-ni... (PRICES WILL INCREASE SOON)
    You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
    _____________________________________________________________
    In this video 📝 I teach you my system to become an AI engineer or freelancer. Life-time access, personal help by me and I will show you exactly how I went from below average student to making $250/hr. Join the High Earner AI Career Program here 👉 www.nicolai-ni... (PRICES WILL INCREASE SOON)
    You will also get access to all the technical courses inside the program, also the ones I plan to make in the future! Check out the technical courses below 👇
    If you enjoyed this video, be sure to press the 👍 button so that I know what content you guys like to see.
    _____________________________________________________________
    🛠️ Freelance Work: www.nicolai-ni...
    _____________________________________________________________
    💻💰🛠️ High Earner AI Career Program: www.nicolai-ni...
    ⚙️ Real-world AI Technical Courses: (www.nicos-scho...)
    📗 OpenCV GPU in Python: www.nicos-scho...
    📕 YOLOv7 Object Detection: www.nicos-scho...
    📒 Transformer & Segmentation: www.nicos-scho...
    📙 YOLOv8 Object Tracking: www.nicos-scho...
    📘 Research Paper Implementation: www.nicos-scho...
    📔 CustomGPT: www.nicos-scho...
    _____________________________________________________________
    📞 Connect with Me:
    🌳 linktr.ee/nico...
    🌍 My Website: www.nicolai-ni...
    🤖 GitHub: github.com/nic...
    👉 LinkedIn: / nicolaiai
    🐦 X/Twitter: / nielsencv_ai
    🌆 Instagram: / nicolaihoeirup
    _____________________________________________________________
    🎮 My Gear (Affiliate links):
    💻 Laptop: amzn.to/49LJkTW
    🖥️ Desktop PC:
    NVIDIA RTX 4090 24GB: amzn.to/3Uc7yAM
    Intel I9-14900K: amzn.to/3W4Z5Cb
    Motherboard: amzn.to/4aR6wBC
    32GB RAM: amzn.to/3Jt2XVR
    🖥️ Monitor: amzn.to/4aLP8hh
    🖱️ Mouse: amzn.to/3W501GH
    ⌨️ Keyboard: amzn.to/3xUGz5b
    🎙️ Microphone: amzn.to/3w1F1WK
    📷 Camera: amzn.to/4b4Ryr9
    _____________________________________________________________
    Tags:
    #OpenCV #opencvGPU #NVIDIA #Cuda #ComputerVision #OpenCVpython #Python

КОМЕНТАРІ • 118

  • @NicolaiAI
    @NicolaiAI  Рік тому +1

    Join My AI Career Program
    www.nicolai-nielsen.com/aicareer
    Enroll in My School and Technical Courses
    www.nicos-school.com

  • @uncleanggi
    @uncleanggi 6 місяців тому +1

    Thank you Nicolai, Two Days I can't sleep resolving this!

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

      Awesome man! Hope you can get some sleep now

  • @daffiduck
    @daffiduck Рік тому +2

    I am using VS 2022 Professional and this works fine no issues thanks bro !

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      Thanks! Glad that it worked out

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

      I am using V4.70 the latest it all seems to work fine there is no issues I did try the version in the video and it came up with lots of RED errors ​@@NicolaiAI

  • @gabrielsemonis4814
    @gabrielsemonis4814 Рік тому +5

    Awesome tutorial. One question though, how can i use the cv2 package in other virtual environments? I tried creating a sym link from the virtual env site packages folder to the base anaconda cv2 package but importing fails

  • @ankithreddy9821
    @ankithreddy9821 Рік тому +2

    I tried many times but there is an error showing up
    error C4430: missing ty
    pe specifier - int assumed. Note: C++ does not support default-int (compiling source file C:\Users\ankit\OpencvGpu\buil
    d\modules\world\mathfuncs_core.avx.cpp) [C:\Users\ankit\OpencvGpu\build\modules\world\opencv_world_AVX.vcxproj]

  • @Anndres47
    @Anndres47 Рік тому +2

    Nice tutorial mate, I had a lot of issues but following everything step by step IT WORKED. I used regular python (not Anaconda) :)

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

      Thanks for watching! Glad that it helped u out

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

      @@NicolaiAI Hi, I'm getting this error when trying to import the generated cv2 library to python: ImportError: DLL load failed while importing cv2: The specified module could not be found. Any thoughts?

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

      Hello, I wanted to use regular python also with vs code, but when I try to import it in the terminal with python, the following error appears: "ModuleNotFoundError No module named cv2"
      Can you help me?

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

      @@Anndres47 I had the same issue. I tried to debug it with looking at the dependencies of the pyd file. I didn't find anything missing but some windows libraries are imported in a way that they end up running down a recursive include. I think the python import times out or has a limited depth for the dependencies. (1 get a 7k dll dependencies with a depth of 10)
      I didn't need to rebuild I just needed to install anaconda and add: os.add_dll_directory(r'C:\Users\username\Anaconda3\Library\bin') to the init of the package.

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

      ​@@filipecarvalho5812 Did you run the install after the build? You need to have the package either in your user python directory or in the system wide.
      In the default configuration it tries to install in the system python which needs admin rights.
      As commented in my other comment you will need to install anaconda anyway. So you can also go straight for that.

  • @cagdasgulec1634
    @cagdasgulec1634 Рік тому +6

    I did what you said excitely with CUDA11.3,CMAKE2.4.2,OPENCV4.5.2(and contrib) but when i want to try the last thing of import cv2 example i gave that error and i think it couldn't installed correctly.
    I tried almost 20 hours it but i couldn't success.
    what can i do please help me.
    *******************
    >>> import cv2
    Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'
    ******************

    • @tudoreugenchindea2414
      @tudoreugenchindea2414 Рік тому +1

      Hello, did you manage to solve the error? I tried to install it three times and i get the same output. I Would really appreciate some help. Thanks

    • @minhnghianguyen5086
      @minhnghianguyen5086 10 місяців тому

      ​@@tudoreugenchindea2414hi bro, I also encountered the same problem.Did you fix it?😢.Thanks bro🙏🏻🙏🏻

  • @daniel_blackWindy
    @daniel_blackWindy Рік тому +2

    " The library is compiled without CUDA support in function 'throw_no_cuda' "
    somebody face this issue?
    opencv : 4.6
    python : 3.9.13
    cuda version : 11.7

  • @uzumatv
    @uzumatv Рік тому +2

    I from Brazil Tanks brow

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

      Thanks a lot for watching bro!

  • @carboqaddumi3944
    @carboqaddumi3944 2 місяці тому +1

    I waited for it to build for 2 hours and at the end it failed because i didnt run cmd in administrator mode...

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

      If u rerun with admin it will take a few mins

  • @luisdavi9124
    @luisdavi9124 Рік тому +3

    6:20 I didn't understand how to choose the correct bin number. Why did you let 6.1:8.6? Is it the range of your GPU's transistors?

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      It’s the version of ur gpu. Can be found on wiki as showed in the video

  • @eddygonzalez6513
    @eddygonzalez6513 Рік тому +3

    Hello, I have been googling and I have not found anything regarding feature extraction (ORB, SIFT, SURF) for CUDA in python, where could I find some information, everything that appears is in C++, could someone help me?

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

      I’ll make a tutorial about OpenCV gpu with python

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

      @@NicolaiAI Ohh great thanks because I can't find anything about feature extraction, visual odometry in python using CUDA

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

      Sameeeeee question here

  • @badassaman5528
    @badassaman5528 Рік тому +3

    its saying that
    Traceback (most recent call last):
    File "", line 1, in
    ModuleNotFoundError: No module named 'cv2'

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

      Hello, did you manage to solve the error? I tried to install it three times and i get the same output. I Would really appreciate some help. Thanks

    • @owentaminman1996
      @owentaminman1996 9 місяців тому

      I got the same issue as well. Struggling this for few days.

  • @BLOCKBUSTERMOVIES1-br9ys
    @BLOCKBUSTERMOVIES1-br9ys 2 місяці тому +1

    Please help me fixing this error: CMake Error at modules/dnn/CMakeLists.txt:41 (message):
    DNN: CUDA backend requires cuDNN. Please resolve dependency or disable
    OPENCV_DNN_CUDA=OFF

  • @afollowerofchrist5789
    @afollowerofchrist5789 Рік тому +2

    Thank you very much for the thorough walkthrough! Everything seems to be going well for me except for the final part. I tried with VS 16 2019, and VS 17 2022, and still getting the exact same error every time. I even tried changing the directories:
    cuda.printCudaDeviceInfo(0)
    Traceback (most recent call last):
    File "", line 1, in
    cv2.error: OpenCV(4.8.0) 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'.
    I'm running on RTX 3050, so my CUDA_ARCH_BIN is 8.6. Please let me know how to resolve this. Thank you again!
    EDIT: I forgot to mention. I have CUDA 12.2. I don't know if that affects things or not.

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

      Opencv version is 4.5.2 not a 4.8.0

    • @afollowerofchrist5789
      @afollowerofchrist5789 Рік тому +2

      @antonioentringer5947 This reply is wrong on many levels. One of the obvious ones is to imply that this only works for version 4.5.2, not 4.8.0 (which is not at all true if you read other sites, or just the comment section, really). Second, it doesn't address at all the error in question, nor the description provided for it. OpenCV IS being detected. Even in other versions, it would get detected, but still, it would give the same error.

    • @Seedx
      @Seedx 7 місяців тому

      @@afollowerofchrist5789 did you ever figure this out? I'm having the same issue

    • @afollowerofchrist5789
      @afollowerofchrist5789 6 місяців тому +1

      @@Seedx Yes, actually, but surprisingly, it worked on Visual Studio 2019 instead of Jupyter Notebook, even though that's where I had installed everything. OK, so just delete the "build" folder, and restart everything from scratch just like in the video. HOWEVER, there is a key difference here. You see, there is actually a developer fault in both files "region.hpp" and "normalize_bbox.hpp". These files are found in: ...opencv-4.8.0\modules\dnn\src\cuda4dnn\primitives.
      I won't go into the details, but what you have to do is fix the following lines in the command:
      In region.hpp:
      Replace:
      *if (nms_iou_threshold > 0.0)*
      With:
      *if (nms_iou_threshold > static_cast(0.0))*
      And in normalize_bbox.hpp:
      Replace:
      *if (weight != 1.0)*
      With:
      *if (weight != static_cast(1.0))*
      Now, rebuild everything just like in the video. Run your code in Visual Studio environment instead of Jupyter, and it will work. It did for me.

  • @yuvanraj1556
    @yuvanraj1556 9 місяців тому

    LINK : fatal error LNK1181: cannot open input file 'lib.lib' [C:\Users\admin\opencvGPU\build\modules\world\opencv_world
    .vcxproj]
    Im getting this error after running the command line .

  • @seregasame
    @seregasame 10 місяців тому +1

    thanks for the video! I did it. how do I create a python package from this build that can simply be installed on another computer?

    • @NicolaiAI
      @NicolaiAI  10 місяців тому

      Thanks for watching! My pleasure. You can use docket for that and just include the cmake installation in the dockerfile. You would need to specify the arguments in cmake instead of the gui. Might do a video about it soon!

  • @EBINHD
    @EBINHD Рік тому +1

    ive literally struggled an week with this and still cannot get it to work
    "module 'cv2' has no attribute 'dnn'"

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

      U have to check that off in cmake as well

  • @ambarpathakkilbar
    @ambarpathakkilbar 5 місяців тому

    cudnn is always showing no after I do everything as directed please help I am struggling a lot

  • @alexandershim6205
    @alexandershim6205 10 місяців тому +1

    Thanks for tutorial! I faced the issue that it works in cmd, but in pycharm venv it outputs cv2.error: OpenCV(4.8.0) 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'. Has anyone faced it too and fixed?

    • @electronicsrs4840
      @electronicsrs4840 7 місяців тому

      llegue a lo mismo

    • @bykush24
      @bykush24 5 місяців тому

      I am facing it but still couldn't find a solution

  • @user-vu2sm3vp8l
    @user-vu2sm3vp8l 7 місяців тому

    I created a new environment and followed the same steps as you did and everything seemed fine ,until I went to check if it successfully was installed.I got an error when importing cv2 not found. have you any suggestions why ??

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

    CMake Error at modules/dnn/CMakeLists.txt:53 (message):
    DNN: CUDA backend requires cuDNN. Please resolve dependency or disable
    OPENCV_DNN_CUDA=OFF
    Call Stack (most recent call first):
    modules/world/CMakeLists.txt:13 (include)
    modules/world/CMakeLists.txt:50 (include_one_module)

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

    I get the following error when running the build:
    cmake --build "/opencv/build" --target INSTALL --config Release
    make: *** No rule to make target 'INSTALL'. Stop.
    Any thoughts on what to change?

  • @EBINHD
    @EBINHD Рік тому +1

    itd be nice to specify cuda version since 12 seems to not work..?

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

      I just did it with newest version of opencv and 12.1 a couple of days ago

  • @christovanwyk1348
    @christovanwyk1348 Рік тому +1

    Getting an error when importing cv2 in Python 3.10: Traceback (most recent call last):
    File "", line 1, in
    File "C:\ProgramData\Anaconda3\lib\site-packages\cv2\__init__.py", line 181, in
    bootstrap()
    File "C:\ProgramData\Anaconda3\lib\site-packages\cv2\__init__.py", line 112, in bootstrap
    load_first_config([
    File "C:\ProgramData\Anaconda3\lib\site-packages\cv2\__init__.py", line 109, in load_first_config
    raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
    ImportError: OpenCV loader: missing configuration file: ['config-3.9.py', 'config-3.py']. Check OpenCV installation.

  • @abdelhaksaouli8802
    @abdelhaksaouli8802 Рік тому +1

    am getting DLL load failed while importing cv2: The specified module could not be found.

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

      U need to install it again

    • @abdelhaksaouli8802
      @abdelhaksaouli8802 Рік тому +1

      @@NicolaiAI thanks for replay, the problem was caused do numpy version miss match

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

      Yeah often mismatch from other installed dependencies afterwards

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

    first: Sorry for spamming into your comment setcion.
    second. I could fix the cudnn error (had to copy it into the specific folders of the cuda-installation)
    third: Now i get this error: CUDA: OpenCV requires enabled 'cudev' module from 'opencv_contrib'

  • @ashinkunjumon3295
    @ashinkunjumon3295 Рік тому +1

    the build installation simpy ends in between for me any help

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

      Have you solved the problem?

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

    Sorry but the step at 6:50 was way too fast. Can u explain how i get the correct number with a certain graphics card? E.G. i work with a RTX 3050 mobile. How to set the correct number at arch bin ? Or is this step not important?

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

    can i provide to you my errors to make sure i didn't do anything wrong?
    errors from cmake configuration output and visual studio build output

  • @jnoe491
    @jnoe491 Рік тому +1

    I was able to build it but did not include the cudnn files, Once I tried adding them I keep getting this build error
    CMake Error at cuda_compile_1_generated_gpu_mat.cu.obj.Release.cmake:220 (message):
    Error generating
    Using 4.5.2 and 11.3.
    Any advice? I found old github posts mentioning changing the detectcuda file, but this one is completely different.

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

      i have the same issue, you can just untick cudnn if you dont need to use neural network stuff, but if you do, i read online that after you copy the bin, lib, and include files into the corresponding CUDA directories, you need to restart and check if it works, some were saying you need to include the path in widnows, tried that but didnt change much

  • @importon
    @importon 7 місяців тому +1

    Why can't we simply download a prebuilt one?

    • @NicolaiAI
      @NicolaiAI  7 місяців тому

      Old versions and you can't customise your installation. Also prebuilt ones does not work on python and on all platforms often

  • @QuarktaschemitSenf
    @QuarktaschemitSenf Рік тому +2

    Hello there. Im stuck at 6:13. It does not show me Cuda Fast math at this point. Which step did i miss

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

      Did u install Cuda correctly?

    • @QuarktaschemitSenf
      @QuarktaschemitSenf Рік тому +1

      @@NicolaiAI does it matter which version i do install? For visual studio at the point of release only the 2019 was supported, but meanwhile it supports (at least it says in the gui) 2022. How is it with Cuda? I installed the normal Cuda-package already but im unsure about cuDNN. Is there a tutorial for that?

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

      U can only use 2019. I couldn’t get it to work with 2022. If u don’t need dnn u can just skip or else there is a link for the dnn module that u can download. I have a video about OpenCV gpu on this channel that covers that part. It’s around 25 min long

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

      @@NicolaiAI Can u link it maybe? So i installed the Cuda Package, i also copied my CUdnn files to the folder suggested at the installation guide @nvdia. But i get the message "Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) (Required is at least version "7.5")"
      The only step i didnt do during the installation is adding cuDNN to my visual studio project (Step 5 in the cudnn tutorial)

    • @QuarktaschemitSenf
      @QuarktaschemitSenf Рік тому +1

      Also i have to mention i did use OpenCV 4.6. Do i need to use 4.5.2 ?
      Edit: Meanwhile i also followed the steps to integrate cuda into Visual Studio. Although im not sure if have done it correctly. However i still get the same error message. I am clueless why the installation progress for cuda has to be even more complicated than installing drivers 25 years ago (from Nvidias side, your explanation was very helpful although i still couldnt make it run)
      edit 2: meanwhile i can see the fast math option for cuda

  • @mikemenders
    @mikemenders 7 місяців тому

    Helo, Your video is very helpful, thank you! I get such an error when loading the configuration file:
    CMakeLists.txt:26 (message):
    cudacodec::VideoReader requires Nvidia Video Codec SDK. Please resolve
    dependency or disable WITH_NVCUVID=OFF
    I have downloaded the NVIDIA Video Codec SDK, but I don't know which files to copy to where to copy them to opencv
    Update1: I solved it according to the description below, copied the necessary files. The configuration and generation runs without errors. I'm in Venv and then started the installation command. This also ran. However, the python in venv does not see the cuda. I am in Windows 10.

  • @ardaaldoe4984
    @ardaaldoe4984 Рік тому +1

    i have succeeded to perform all processes and i got the result from this code
    >>> import cv2
    >>> from cv2 import cuda
    >>> cuda.printCudaDeviceInfo(0)
    and detected my external/extended GPU in my laptop
    but when i run the program and i saw prom task manager, why only CPU that has process until 70% and GPU0 (internal/integrated/GPUIntel) has low progress around 10% and my extended GPU (NVIDIA) didnt have any progress?
    can you help explain it why? because its look like my NVIDIA didnt work when i run the program
    thanks for your answer

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

      Thats because u are not running anything on the gpu yet

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

      @@NicolaiAI can you give me a code sample or tutorial to test my NVIDIA gpu in my laptop, or to run some applications or systems using my NVIDIA gpu
      thanks for your response

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      @@ardaaldoe4984 i have a course covering everything about how to use the gpu with opencv and even numpy on the gpu

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

    Hi. I could successfully follow this,thanks a lot.... But I am getting this error when I write import cv2.
    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Users\parth\AppData\Local\Programs\Python\Python37\lib\site-packages\cv2\__init__.py", line 181, in
    bootstrap()
    File "C:\Users\parth\AppData\Local\Programs\Python\Python37\lib\site-packages\cv2\__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
    File "C:\Users\parth\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    ImportError: DLL load failed: The specified module could not be found.
    Could you please help me with this.
    Thanks in advance. i was seeing

  • @ghymes1999
    @ghymes1999 Рік тому +1

    thx

  • @bareMinimumExample
    @bareMinimumExample Рік тому +1

    Python (for build): C:\Users\jeg\anaconda3\python.exe does show, but not the "python 3"/lines. any hints? Note: i had to use visual studio 2017, 2019 did not show as an option in cmake-gui (2019 was installed originally)

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

      Does it show numpy path? If not, u should upgrade numpy and that should fix it

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

      @@NicolaiAI I have the same problem.. It only shows Python (for build) but not Python 3 with the lines below (including Numpy), I made 100% sure that numpy is on the latest version and yet the error still persists. //EDIT: I manually added all of the Paths but when I try to install the configuration, it takes like 40 seconds and doesn't even come to "-installing" as seen in the end of your installation.

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

      @@lukasTHEwise having same issue, was it resolved for you?

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

      @@shreyashkhedkar2491 Make sure you have installed python on ur system drive, that was my problem at least..

  • @mfraifer
    @mfraifer Рік тому +1

    Plz .I need your help to set cuda GPU.

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      Hi have u seen the opencv course I’ve made. I go over all of it and provide support in there

  • @stickmanjournal
    @stickmanjournal Рік тому +1

    Thanks for the great tutorial, it's very easy to follow!
    Everything works as expected, however, I'm getting this error while trying to print cuda device info
    cuda.printCudaDeviceInfo(0)
    Traceback (most recent call last):
    File "", line 1, in
    cv2.error: OpenCV(4.7.0) 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'
    Do you know what causes the error and how to resolve it?
    Thanks in advance :)

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

      which gpu u have

    • @afollowerofchrist5789
      @afollowerofchrist5789 Рік тому +1

      @@GamingXYT I too am getting this exact same error, but with OpenCV 4.8.0. I know the CUDA compatibility version is 8.6, because I have RTX 3050.

  • @carlzmarasiganz5353
    @carlzmarasiganz5353 Рік тому +2

    No module named cv2, please help🥺

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

      Did u verify that it was able to detect Python in the Cmake configurations?

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

      I fix the cv2, but after that another error 'throw_no_cuda' please help🙏

    • @isaacmejiaf.1747
      @isaacmejiaf.1747 Рік тому

      @@NicolaiAI I have same error after done the install process, Cmake detect Python in configuratión process, please help :c

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

      @@carlzmarasiganz5353 How did you manage to solve de import cv2 error?

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

    (base) PS C:\WINDOWS\system32> python
    Python 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cv2
    >>> from cv2 import cuda
    Traceback (most recent call last):
    File "", line 1, in
    ImportError: cannot import name 'cuda' from 'cv2' (unknown location)
    >>>

  • @luisdavi9124
    @luisdavi9124 Рік тому +1

    Hello, thanks for your tutorial ! It worked for most gpu with cv2 codes i tested. But it didn't worked when i tried to activate yolo gpu with cv2.dnn.DNN_BACKEND_CUDA and cv2.dnn.DNN_TARGET_CUDA parameters. I think it's because i get too many warning messages on visual studio when i'm building the package (thousands of warnings about opencv_world). I want to know if you could upload somewhere your cv2 package file please. I want to compare the files i build and the ones you build and understand what is going wrong for me. Maybe is something missing when i try to compile.

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      I have another tutorial here on the channel where I also build it with dnn support. That’s another step which is not covered in this video.

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

      @@The-Dark-Tower my longer video with the installation. But u can basically just search for dnn in cmake and set the flag

  • @luisdavi9124
    @luisdavi9124 Рік тому +1

    Which CUDA version did you use? I managed to generate everything as you, same OpenCV and Visual Studio versions, but i'm struggling with the final release part. My cmd doesn't do cmake -build "C:\your_path\build" --target INSTALL --config Release. I saw that it's possible to do this with visual Studio. So i openned my Visual Studio 2019 and runned it. But around the line 27 it begins to fail. The most failable modules are related to OpenCV_World. By the end says that 26 compilations succeded and 99 failed. My cuda is the last released one. So i wonder if that's the problem. Or if it's the fact that i did the last part without cmd.

    • @NicolaiAI
      @NicolaiAI  Рік тому +1

      I’m using 11.3

    • @DevinTan-ph6gn
      @DevinTan-ph6gn 10 місяців тому

      you need to create a new path to variable system for cmake, so the prompt can recognize the cmake

  • @srsaguilar
    @srsaguilar 7 місяців тому +2

    i passed every procedure and replicates the steps and no errors, but when checking it "import cv2" it appears no Module named 'cv2' why?

  • @uzhuuu
    @uzhuuu 5 місяців тому

    es normal que tarde tanto?

  • @christovanwyk1348
    @christovanwyk1348 Рік тому +1

    Does this work with Amd gpus?

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

    sht didnt work

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

    ive done this tutorial over and over again, yet still I'm getting this:
    NVIDIA CUDA: YES (ver 12.2, CUFFT CUBLAS)
    NVIDIA GPU arch: 50 52 60 61 70 75 80 86 89 90
    NVIDIA PTX archs:
    cuDNN: YES (ver 8.1.0)
    OpenCL: YES (NVD3D11)
    Include path: C:/opencv-4.8.0/3rdparty/include/opencl/1.2
    Link libraries: Dynamic load
    Python (for build): C:/Users/*user*/anaconda3/python.exe
    Java:
    ant: NO
    Java: YES (ver 20.0.1)
    JNI: C:/Program Files/Java/jdk-20/include C:/Program Files/Java/jdk-20/include/win32 C:/Program Files/Java/jdk-20/include
    Java wrappers: NO
    Java tests: NO
    Install to: C:/opencv-4.8.0/build/install

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

    I have followed this instruction exactly but mid INSTALL got this error when trying to build the opencv_core460.lib from opencv_core.vcsproj
    nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft V
    isual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/../../../../../../../VC/Auxiliary/Build/vcvars6
    4.bat'

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

      Nvm, if anyone encounter this error. Ensure environment path has no weird symbols like double quotes or "/". Also to run the cmake command from cmd admin instead of power shell