Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
531a2eaf
"doc/vscode:/vscode.git/clone" did not exist on "346d2022970959674a6c4296ed64a78bd0367d7e"
Unverified
Commit
531a2eaf
authored
Oct 11, 2022
by
Andrey Talman
Committed by
GitHub
Oct 11, 2022
Browse files
Fix for windows and python 3.8 call to add_dll_directory (#6742) (#6743)
parent
95bef271
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
torchvision/extension.py
torchvision/extension.py
+5
-1
No files found.
torchvision/extension.py
View file @
531a2eaf
...
...
@@ -21,12 +21,16 @@ try:
# To find cuda related dlls we need to make sure the
# conda environment/bin path is configured Please take a look:
# https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python
# Please note: if some path can't be added using add_dll_directory we simply ignore this path
if
os
.
name
==
"nt"
and
sys
.
version_info
>=
(
3
,
8
)
and
sys
.
version_info
<
(
3
,
9
):
env_path
=
os
.
environ
[
"PATH"
]
path_arr
=
env_path
.
split
(
";"
)
for
path
in
path_arr
:
if
os
.
path
.
exists
(
path
):
try
:
os
.
add_dll_directory
(
path
)
# type: ignore[attr-defined]
except
Exception
:
pass
lib_path
=
_get_extension_path
(
"_C"
)
torch
.
ops
.
load_library
(
lib_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment