diff options
| -rw-r--r-- | rpc/listener.py | 4 |
1 files changed, 2 insertions, 2 deletions
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") |
