From 9b896ff0e91393e2aab9126b64efcc9c9e00c519 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 30 Aug 2018 12:11:21 +0200 Subject: epochs --- rpc/listener.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rpc') diff --git a/rpc/listener.py b/rpc/listener.py index c54dc89..87eea37 100644 --- a/rpc/listener.py +++ b/rpc/listener.py @@ -7,13 +7,13 @@ from img_ops import process_image def list_checkpoints(payload): print("> list checkpoints") - return sorted([f.split('/')[3] for f in glob.glob('./checkpoints/' + payload + '/*/latest_net_G.pth')]) + return sorted([f.split('/')[3] for f in glob.glob(os.path.join('./checkpoints/', payload, '/*/latest_net_G.pth'))]) def list_epochs(path): print("> list epochs for {}".format(path)) if not os.path.exists(os.path.join('./checkpoints/', path)): return "not found" - return sorted([f.split('/')[4].replace('_net_G.pth','') for f in glob.glob('./checkpoints/' + path + '/*_net_G.pth')]) + return sorted([os.path.basename(f).replace('_net_G.pth', '') for f in glob.glob(os.path.join('./checkpoints/', path, '/*_net_G.pth'))]) def list_sequences(module): print("> list sequences") -- cgit v1.2.3-70-g09d2