forked from akshathmangudi/rgb-to-hyper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_restore.py
31 lines (27 loc) · 936 Bytes
/
test_restore.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# test_restore.py
import tensorflow as tf
import os
import logging
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
def list_all_checkpoints(checkpoint_dir):
"""
Lists all available checkpoints in the specified directory.
Args:
checkpoint_dir (str): Path to the checkpoints directory.
Returns:
None
"""
checkpoints = tf.train.get_checkpoint_state(checkpoint_dir)
if checkpoints and checkpoints.all_model_checkpoint_paths:
logging.info("Available checkpoints:")
for path in checkpoints.all_model_checkpoint_paths:
print(path)
else:
logging.error("No checkpoints found in the specified directory.")
if __name__ == "__main__":
CHECKPOINT_DIR = r'C:\Harshi\ecs-venv\rgb-to-hyper\rgb-to-hyper-main\rgb-to-hyper\checkpoints'
list_all_checkpoints(CHECKPOINT_DIR)