瀏覽代碼

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."
             )