File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 22# @Author: SWHL
3344import os
5- import platform
5+ import sys
66import traceback
77from enum import Enum
88from pathlib import Path
@@ -132,16 +132,16 @@ def _check_dml(self) -> bool:
132132 if not self .cfg_use_dml :
133133 return False
134134
135- cur_os = platform .system ()
136- if cur_os != "Windows" :
135+ if sys .platform != "win32" :
137136 self .logger .warning (
138- "DirectML is only supported in Windows OS. The current OS is %s. Use %s inference by default." ,
139- cur_os ,
137+ "DirectML is only supported in Windows OS. The current OS is %s. "
138+ "Refer to https://docs.python.org/3/library/sys.html#sys.platform for more details. Use %s inference by default." ,
139+ sys .platform ,
140140 self .had_providers [0 ],
141141 )
142142 return False
143143
144- cur_window_version = int ( platform . release ().split ( "." )[ 0 ])
144+ cur_window_version = sys . getwindowsversion ().major
145145 if cur_window_version < 10 :
146146 self .logger .warning (
147147 "DirectML is only supported in Windows 10 and above OS. The current Windows version is %s. Use %s inference by default." ,
You can’t perform that action at this time.
0 commit comments