From 3ca51e80b22539b92def4031a58388ad2cc6c193 Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 5 Aug 2021 22:21:25 -0600 Subject: [PATCH] Only fix weird path bug in windows --- codes/trainer/networks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codes/trainer/networks.py b/codes/trainer/networks.py index e0733ffe..a68a2ee9 100644 --- a/codes/trainer/networks.py +++ b/codes/trainer/networks.py @@ -37,8 +37,9 @@ def find_registered_model_fns(base_path='models'): found_fns = {} module_iter = pkgutil.walk_packages([base_path]) for mod in module_iter: - if os.getcwd() not in mod.module_finder.path: - continue # I have no idea why this is necessary - I think it's a bug in the latest PyWindows release. + if os.name == 'nt': + if os.getcwd() not in mod.module_finder.path: + continue # I have no idea why this is necessary - I think it's a bug in the latest PyWindows release. if mod.ispkg: EXCLUSION_LIST = ['flownet2'] if mod.name not in EXCLUSION_LIST: