Build CUDA Opencv with Python 3.8 Bindings for GTuner
17 posts
• Page 2 of 2 • 1, 2
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
might want to add to your tutorial that you need 2019 version of visual studio.
https://docs.microsoft.com/en-us/visual ... ease-notes
cuda said it couldnt find visual studio when using the newest one.
... its also stated on nvidia's installation guidelines
https://docs.nvidia.com/cuda/cuda-insta ... l#abstract
***EDIT, oh you do specify 2019 in the link text. i clicked the download button was right in my face, so i got the newest one. the link i posted is a little more noob friendly
https://docs.microsoft.com/en-us/visual ... ease-notes
cuda said it couldnt find visual studio when using the newest one.
... its also stated on nvidia's installation guidelines
https://docs.nvidia.com/cuda/cuda-insta ... l#abstract
***EDIT, oh you do specify 2019 in the link text. i clicked the download button was right in my face, so i got the newest one. the link i posted is a little more noob friendly
-
fullerorb7 - Master Sergeant
- Posts: 37
- Joined: Sun Feb 21, 2016 8:09 pm
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
Hi all,
Getting the following error after running the import cv2 command. What am I doing wrong?
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Getting the following error after running the import cv2 command. What am I doing wrong?
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing cv2: The specified module could not be found.
-
TR1PL3D - Sergeant
- Posts: 9
- Joined: Tue Nov 17, 2015 12:58 am
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
TR1PL3D wrote:Hi all,
Getting the following error after running the import cv2 command. What am I doing wrong?
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing cv2: The specified module could not be found.
open anaconda prompt (gpu) and enter:
pip install opencv-python==4.4.0.40
python
import os
os.add_dll_directory(r'C:\Users\YOUR_USER\anaconda3\envs\gpu\lib\opencv-4.4.0\build\install\x64\vc16\bin')
import cv2
cv2.__version__
Last edited by LuciT21 on Fri Apr 14, 2023 11:51 pm, edited 1 time in total.
-
LuciT21 - Private First Class
- Posts: 2
- Joined: Tue Jan 25, 2022 4:32 am
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
LuciT21 wrote:TR1PL3D wrote:Hi all,
Getting the following error after running the import cv2 command. What am I doing wrong?
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing cv2: The specified module could not be found.
open anaconda prompt (gpu) and enter:
import os
os.add_dll_directory('C:\Users\YOUR_USER\anaconda3\envs\gpu\lib\opencv-4.4.0\build\install\x64\vc16\bin')
import cv2
Thanks for your help.
Unfortunately that hasn't worked for me.
I get the follow after running the command you kindly gave me.
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
What could I try next?
Thanks
EDIT*
A quick Google search showed an easy way to get the command to work
Adding an "r" to the command.
So like this: os.add_dll_directory(r'C:\Users\YOUR_USER\anaconda3\envs\gpu\lib\opencv-4.4.0\build\install\x64\vc16\bin')
This gave me the output: <AddedDllDirectory('C:\\Users\\DoZZa\\anaconda3\\envs\\gpu\\lib\\opencv-4.4.0\\build\\install\\x64\\vc16\\bin')>
I then run >>> cv2.cuda.getCudaEnabledDeviceCount()
But still get 0 returned.
0
-
TR1PL3D - Sergeant
- Posts: 9
- Joined: Tue Nov 17, 2015 12:58 am
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
I just ordered a 4070 ti and more RAM for this lol.
-
mrbubbles2k4 - Sergeant
- Posts: 7
- Joined: Mon Aug 09, 2021 3:20 pm
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
followed every step and I am getting the sdame error when I try to import the cv
-
mrbubbles2k4 - Sergeant
- Posts: 7
- Joined: Mon Aug 09, 2021 3:20 pm
Re: Build CUDA Opencv with Python 3.8 Bindings for GTuner
TR1PL3D wrote:LuciT21 wrote:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
The error message you're seeing indicates that Python encountered a string with a Unicode escape sequence that is truncated, meaning it doesn't have the required number of hexadecimal digits. The position 2-3 in the error message refers to the location in the string where the error occurred.
You can solve this error "codec can't decode bytes" by using a raw string by prefixing your string with the letter "r". Raw strings don't interpret backslashes as escape characters.
path = r"C:\Users\User\Documents\file.txt"
Double the backslashes in your string
path = "C:\\Users\\User\\Documents\\file.txt"
Use forward slashes instead of backslashes
path = "C:/Users/User/Documents/file.txt"
Unicode escape sequences can be used in both single-quoted ('...') and double-quoted ("...") strings in Python. However, it's important to note that in Python 3, strings are Unicode by default, so you can also include Unicode characters directly in a string without using escape sequences, as long as you use the appropriate character encoding.
-
linehammer - Private
- Posts: 1
- Joined: Mon Feb 27, 2023 5:55 am
17 posts
• Page 2 of 2 • 1, 2
Return to Gtuner Computer Vision
Who is online
Users browsing this forum: No registered users and 25 guests