소스 검색

fix in windows

Path("https://xxx/xxx") would cause error on Windows
gaotingquan 10 달 전
부모
커밋
50c18d3a73
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      paddlex/modules/base/exportor.py

+ 6 - 1
paddlex/modules/base/exportor.py

@@ -78,7 +78,12 @@ class BaseExportor(ABC, metaclass=AutoRegisterABCMetaClass):
         """
 
         config_path = Path(weight_path).parent / "config.yaml"
-        if not config_path.exists():
+        # `Path("https://xxx/xxx")` would cause error on Windows
+        try:
+            is_exists = config_path.exists()
+        except Exception:
+            is_exists = False
+        if not is_exists:
             logging.warning(
                 f"The config file(`{config_path}`) related to weight file(`{weight_path}`) is not exist, use default instead."
             )