-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
26 lines (20 loc) · 799 Bytes
/
utils.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
from config import *
#Clear contents of logging file
a_file = open(logging_path, "w")
a_file.truncate()
a_file.close()
print("Cleared log file")
#Remove tb logging files
shutil.rmtree(tbpath)
print("Removed tb files")
#Get the stats for resuming training
checkpoint = torch.load(save_dir, pickle_module=dill)
epoch = checkpoint['epoch']
loss = checkpoint['loss']
number_of_training_steps = checkpoint['number_of_training_steps']
seed_value_changer = checkpoint["seed_value_changer"]
print(f"Number of epochs completed are {epoch}")
print(f"Number of training steps completed so far in that epoch are {number_of_training_steps}")
print(f"Number of epochs remaining are {num_of_epochs-epoch}")
print(f"Last recorded loss was {loss}")
print(f"The last seed used was {seed_value_changer}")