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

  Рет қаралды 39,236

TheCodingBug

TheCodingBug

Күн бұрын

Get a speedup for OpenCV with CUDA GPU acceleration. Learn how to build OpenCV 4.4.0 with CUDA on Windows 10 from the source. Installing this way allows OpenCV to be used in any programming language. We will focus on Python 3.8 for this tutorial. You can test for C++ and comment below if it worked for the benefit of future viewers.
EDIT: I am using Anaconda with Python 3.8 for this tutorial so I do not need to add any paths to my system variables.
github.com/haroonshakeel/open...
---------------------------------------------
► Time Stamps:
Introduction: (0:00)
Prerequisites: (0:15)
Install CUDA and cuDNN: (2:53)
Make OpenCV using CMake: (4:41)
Build OpenCV using Visual Studio: (6:42)
ERROR - One or More Projects Were Not Loaded Correctly: (7:02)
Install OpenCV on Windows 10: (7:51)
How to verify if OpenCV detects GPU: (8:48)
How to check if OpenCV is using GPU: (9:10)
Want to discuss more?
►Join my discord: / discord
---------------------------------------------
#TheCodingBug
#cuda
#opencv
---------------------------------------------
► My Other Tutorials:
○Build and Install OpenCV 4.5.1 With CUDA GPU Support on Windows 10: • Build and Install Open...
○ YOLOv4 On Android Using TFLite: • YOLOv4 TFLite Object D...
○ Install TensorFlow GPU Under 90 Seconds: • Install TensorFlow GPU...
○ Install PyTorch GPU Under 90 Seconds: • Install PyTorch GPU on...
○ Custom YOLOv4 Object Detection with TensorFlow and TFLite : • Custom Object Detectio...
○ Darknet YOLOv4 Custom Object Detection: Part 2 (Training YOLOv4 Darknet): • YOLOv4 Custom Object D...
○ Darknet YOLOv4 Custom Object Detection: Part 1 (Preparing Custom Dataset): • YOLOv4 Custom Object D...
○ YOLOv4 Object Detection with TensorFlow, TFLite and TensorRT: • YOLOv4 Object Detectio...
○ Darknet YOLOv4 Object Detection for Windows 10 on Images, Videos, and Webcams: • Darknet YOLOv4 Object ...
○ Real-Time Object Detection on Webcam and Videos Using OpenCV With YOLOv3 and YOLOv4 | Windows Linux: • YOLOv4 and YOLOv3 Obje...
○ Install TensorFlow GPU and PyTorch with CUDA on Windows 10 Anaconda | CUDA 10.1 cuDNN 7.6: • Install TensorFlow GPU...
○ Real-time Multiple Object Tracking with YOLOv4 TensorFlow and Deep Sort | Linux, Windows: • Object Tracking with T...
---------------------------------------------
► Follow us on Twitter: / bugcodingthe
► Support us on Patreon: / thecodingbug
---------------------------------------------
DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you!

Пікірлер: 263
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Follow Install CUDA and cuDNN part: kzbin.info/www/bejne/hp26aq13nJmWrpo Updated Tutorial for OpenCV 4.5.1 with Virtual Environment Build: kzbin.info/www/bejne/j6TQmX6Xp52ihcU YOLOv4 with Darknet on Windows: kzbin.info/www/bejne/fHaVeHWbgNqkpsU YOLOv3 YOLOv4 with OpenCV: kzbin.info/www/bejne/fJvcd2NpqsaqqaM YOLOv4 Darknet: kzbin.info/www/bejne/fHaVeHWbgNqkpsU YOLOv4 Custom Detector: kzbin.info/www/bejne/qXynqqaEqdObgJY YOLOv4 TensorFlow and TFLite: kzbin.info/www/bejne/qnTQdGqkrst9ppo
@avnibalkc5066
@avnibalkc5066 3 жыл бұрын
Mate, it was the most helpful video I have ever watched on KZbin. Thank you very much, respect.
@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!!
@mewhenthemewhenstheme
@mewhenthemewhenstheme 7 ай бұрын
Out of all the tutorials I've found for this stuff, this one was by far the best. Thanks a lot.
@gamingin768p7
@gamingin768p7 3 жыл бұрын
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 жыл бұрын
I am glad it was helpful.
@gamingin768p7
@gamingin768p7 3 жыл бұрын
@@TheCodingBug Straight up the best video on this topic on KZbin.Thank you for making this video.
@Patorik1899
@Patorik1899 3 жыл бұрын
Very helpful, informative and straightforward video. Thank you!
@JoonhwanLee
@JoonhwanLee 3 жыл бұрын
coool thanks for this vid! you make my day!!!!
@funwithpk2821
@funwithpk2821 3 жыл бұрын
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 3 жыл бұрын
I am glad I could help. Warnings are okay. Errors are not.
@danniel90
@danniel90 3 жыл бұрын
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.
@deepmodi9354
@deepmodi9354 3 жыл бұрын
Great Tutorial, Thanks.
@TheCodingBug
@TheCodingBug 3 жыл бұрын
I am glad it was helpful.
@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!
@kaandemiray9291
@kaandemiray9291 3 жыл бұрын
It worked. Thank you so much sir.
@TheCodingBug
@TheCodingBug 3 жыл бұрын
I am glad it was helpful.
@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 ?
@cheatyruga7787
@cheatyruga7787 7 ай бұрын
You are the best!
@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?
@HiepNguyen-gq5lp
@HiepNguyen-gq5lp 3 жыл бұрын
thank you so much. i did it!
@gabrielasolano922
@gabrielasolano922 3 жыл бұрын
Excelent! :D
@dedenapraia
@dedenapraia 3 жыл бұрын
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 жыл бұрын
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 2 жыл бұрын
you are one of the person send by god 🙏
@BdyPhrk
@BdyPhrk 3 жыл бұрын
Big thanks!
@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?
@DevilErnest
@DevilErnest 3 жыл бұрын
Thank you. I made sure I have tested it before giving the like and subscribe LOL
@TheCodingBug
@TheCodingBug 3 жыл бұрын
I am glad it was helpful.
@fatihfuad1909
@fatihfuad1909 3 жыл бұрын
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.
@cklee2
@cklee2 2 жыл бұрын
How come when i check cv2.getCudaEnabledDeviceCount() result is 0. how to set to 1?
@rambled
@rambled 3 жыл бұрын
Same problem with someone. Used clean anaconda(3.8.5) but failed, tried python3.8.5 instead and copy the stuff as someone suggested.
@ArunKumar-sg6jf
@ArunKumar-sg6jf 3 жыл бұрын
ii have error on undefined refrefernce function on opencv cuda build can u give any idea to solve thsi
@amitkotagi6265
@amitkotagi6265 2 жыл бұрын
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: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@aykutsirma4260
@aykutsirma4260 3 жыл бұрын
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 kzbin.info/www/bejne/j6TQmX6Xp52ihcU It also covers the installation for virtual environment of Python.
@AkdenAi
@AkdenAi Ай бұрын
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?
@rsalazar9784
@rsalazar9784 3 жыл бұрын
Por favor, muestre todas las banderas / selecciones y caminos indicadas en el CMake de su instalación. Gracias.
@nugratasik4137
@nugratasik4137 10 ай бұрын
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 10 ай бұрын
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
@bektinurwanto
@bektinurwanto 3 жыл бұрын
hi sir, i have problem to install. where i must install location for python??
@arnoldrivera3288
@arnoldrivera3288 3 жыл бұрын
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 kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@wonderavantakam
@wonderavantakam 3 жыл бұрын
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).
@ductin606
@ductin606 2 жыл бұрын
finally i can install it, thank you very much, but the problem i have is not updating numpy before cmake
@nithinprincejohn7762
@nithinprincejohn7762 3 жыл бұрын
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
@yusufucan383
@yusufucan383 3 жыл бұрын
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.
@Tuncaycortez
@Tuncaycortez Жыл бұрын
sorunu çözebildiniz mi
@e101sg
@e101sg 2 жыл бұрын
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 2 жыл бұрын
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 kzbin.info/www/bejne/fHaVeHWbgNqkpsU
@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?
@chiragkaushik2057
@chiragkaushik2057 3 жыл бұрын
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.
@user-gb1ov8we8o
@user-gb1ov8we8o 3 ай бұрын
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 ?
@sujaykadam99
@sujaykadam99 3 жыл бұрын
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 жыл бұрын
just remove the text from search tab it fixes it
@TheCodingBug
@TheCodingBug 3 жыл бұрын
I am glade its fixed.
@thesoulz5030
@thesoulz5030 3 жыл бұрын
Please, add a similar video for LInux OS (Ubuntu 20.04 preferably). Thank you in advance, very good work so far! Thumbs up!
@25_26
@25_26 2 жыл бұрын
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
@NovaratS
@NovaratS 3 жыл бұрын
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. kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@SimeonGreene
@SimeonGreene 3 жыл бұрын
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
@nguyenvu6371
@nguyenvu6371 3 жыл бұрын
Thanks for your turtorial. I have a problem. How to make Pycharm IDE regconize this rebuild opencv module?
@TheCodingBug
@TheCodingBug 3 жыл бұрын
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 жыл бұрын
Add the path to the cv2 directory to your PYTHONPATH system variable. That should help.
@nguyenvu6371
@nguyenvu6371 3 жыл бұрын
@@g4laxy551 thanks mate
@adarshgouda847
@adarshgouda847 3 жыл бұрын
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 жыл бұрын
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.
@mallvin2000
@mallvin2000 3 жыл бұрын
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 kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@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 жыл бұрын
@@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.
@minhdinh3814
@minhdinh3814 3 жыл бұрын
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. kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@saidanianis1923
@saidanianis1923 3 жыл бұрын
File "", line 1, in ModuleNotFoundError: No module named 'cv2' how to fix this
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Try this updated tutorial: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@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".
@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
@helloankur2009
@helloankur2009 3 жыл бұрын
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!
@aqiff123
@aqiff123 3 жыл бұрын
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 жыл бұрын
Are you installing it in virtual environment?
@aqiff123
@aqiff123 3 жыл бұрын
@@TheCodingBug no, not in the virtual environment
@TheCodingBug
@TheCodingBug 3 жыл бұрын
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
@aqiff123
@aqiff123 3 жыл бұрын
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 жыл бұрын
Its okay, everything has solved
@TheCodingBug
@TheCodingBug 3 жыл бұрын
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 жыл бұрын
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
@sefadogan4795
@sefadogan4795 2 жыл бұрын
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 жыл бұрын
You can follow the updated video kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@sefadogan4795
@sefadogan4795 2 жыл бұрын
@@TheCodingBug Thank you for your answer. I will try it
@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.
@dale5021a
@dale5021a 15 сағат бұрын
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?
@abdullahaygun4000
@abdullahaygun4000 3 жыл бұрын
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 жыл бұрын
@@dedenapraia I have same problem, I added that new entry in CMake and still getting same result
@luiscao7241
@luiscao7241 3 жыл бұрын
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 жыл бұрын
@@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
@ParabellumHistory
@ParabellumHistory 3 жыл бұрын
ModuleNotFoundError: No module named 'cv2' The build and installation showed no errors :/
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Try this updated method: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@ParabellumHistory
@ParabellumHistory 3 жыл бұрын
@@TheCodingBug Thanks, it worked!
@linjake2227
@linjake2227 3 жыл бұрын
I run ALL_BUILD and it shows this error "LNK1104: cannot open file 'python38_d.lib'"
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Hi. You can try alternative method. kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@linjake2227
@linjake2227 3 жыл бұрын
@@TheCodingBug Success run, thx.
@andrespereira4852
@andrespereira4852 3 жыл бұрын
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 жыл бұрын
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!
@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 жыл бұрын
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'"
@-yaseenabdulwali4392
@-yaseenabdulwali4392 3 жыл бұрын
What if i only have amd GPU, is there any other way?
@TheCodingBug
@TheCodingBug 3 жыл бұрын
No AMD GPU do not support CUDA.
@mdiftekherhossain6152
@mdiftekherhossain6152 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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.
@hemantchaudhary3465
@hemantchaudhary3465 3 жыл бұрын
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.
@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.
@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 жыл бұрын
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. kzbin.info/www/bejne/qqCtlmuQl6ube8U
@saber3747
@saber3747 3 жыл бұрын
@@TheCodingBug good, thank you.
@helloankur2009
@helloankur2009 3 жыл бұрын
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 жыл бұрын
@@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?
@khaledjbaili8654
@khaledjbaili8654 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@khaledjbaili8654 Rebuild from cmake. First go to File and clear Cache. Then rebuild all configurations from cmake. Then form visual studio.
@awdhootkanawade
@awdhootkanawade 3 жыл бұрын
followed exactly but got 39 success and 153 failed in vs 2017 please help
@TheCodingBug
@TheCodingBug 3 жыл бұрын
It does not work on VS 2017. Also, try this updated tutorial for OpenCV 4.5.1. kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@Tuncaycortez
@Tuncaycortez Жыл бұрын
What is your cudnn version?
@TheCodingBug
@TheCodingBug Жыл бұрын
It's shown in the video. You can try the updated tutorial for it kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@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).
@aayushlakhani2073
@aayushlakhani2073 3 жыл бұрын
Hey, it's not working in conda virtual env, can u help pls ?
@TheCodingBug
@TheCodingBug 3 жыл бұрын
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 жыл бұрын
@@TheCodingBug can i apply the same method for env created via virtualenv or having a conda evn is compulsory?
@TheCodingBug
@TheCodingBug 3 жыл бұрын
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.
@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 жыл бұрын
@@ozlematz2528 I am not sure about Jetson nano.
@ozlematz2528
@ozlematz2528 2 жыл бұрын
@@TheCodingBug Ok .Thank :))
@daniilmaltsev1325
@daniilmaltsev1325 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: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@SuperLittle35
@SuperLittle35 3 жыл бұрын
Where are the links?
@ahuman5383
@ahuman5383 2 жыл бұрын
can i delete the opencv file after built?
@TheCodingBug
@TheCodingBug 2 жыл бұрын
I have covered the cleaning process in my 2021 updated video: kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@ahuman5383
@ahuman5383 2 жыл бұрын
@@TheCodingBug wah I didn't expect such fast reply from you. Thank you sir, I will check it out
@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
@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.
@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 жыл бұрын
@@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 жыл бұрын
@@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.
@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.
@DrFlox
@DrFlox 3 жыл бұрын
Thanks. the explanations were great... but in the last step I still got 131 errors :( FML
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Try this updated method. kzbin.info/www/bejne/j6TQmX6Xp52ihcU
@mlnima
@mlnima Ай бұрын
mine took 5.1 sec to generate 🤔🤔
@nitinkumar29
@nitinkumar29 3 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
I am glad I could help.
@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.
@deepmodi9354
@deepmodi9354 3 жыл бұрын
If you are installing cuda for GPU or following this video ( kzbin.info/www/bejne/fHaVeHWbgNqkpsU ) 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.
@TheCodingBug
@TheCodingBug 3 жыл бұрын
Absolutely right.
@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 жыл бұрын
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.
@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 ==========
@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 10 ай бұрын
Try with VS 2019
How to install OpenCV with CUDA GPU in windows 10 | Python
17:35
Hackers Realm
Рет қаралды 15 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 17 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 58 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 79 МЛН
80 Year Olds Share Advice for Younger Self
12:22
Sprouht
Рет қаралды 1,4 МЛН
Build OpenCV with CUDA Support for Jetson
8:31
JetsonHacks
Рет қаралды 29 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level Learning
Рет қаралды 548 М.
HAPPY BIRTHDAY @mozabrick 🎉 #cat #funny
00:36
SOFIADELMONSTRO
Рет қаралды 17 МЛН