Commit c8d0b2a3 authored by Anthony Larcher's avatar Anthony Larcher
Browse files

monitor display

parent a23b8549
...@@ -1319,8 +1319,16 @@ def new_xtrain(dataset_description, ...@@ -1319,8 +1319,16 @@ def new_xtrain(dataset_description,
training_description, training_description,
kwargs) kwargs)
# Initialize the training monitor
monitor = TrainingMonitor(output_file=training_opts["log_file"],
patience=training_opts["patience"],
best_accuracy=0.0,
best_eer_epoch=1,
best_eer=100,
compute_test_eer=training_opts["compute_test_eer"])
# Initialize the logger in file and console # Initialize the logger in file and console
init_logging(filename=training_opts["log_file"]) #init_logging(filename=training_opts["log_file"])
# Display the entire configurations as YAML dictionnaries # Display the entire configurations as YAML dictionnaries
logging.info(yaml.dump(dataset_opts, default_flow_style=False)) logging.info(yaml.dump(dataset_opts, default_flow_style=False))
...@@ -1365,14 +1373,6 @@ def new_xtrain(dataset_description, ...@@ -1365,14 +1373,6 @@ def new_xtrain(dataset_description,
if training_opts["mixed_precision"]: if training_opts["mixed_precision"]:
scaler = torch.cuda.amp.GradScaler() scaler = torch.cuda.amp.GradScaler()
# Initialize the training monitor
monitor = TrainingMonitor(output_file="log/training_xv.log",
patience=training_opts["patience"],
best_accuracy=0.0,
best_eer_epoch=1,
best_eer=100,
compute_test_eer=training_opts["compute_test_eer"])
for epoch in range(1, training_opts["epochs"] + 1): for epoch in range(1, training_opts["epochs"] + 1):
monitor.update(epoch) monitor.update(epoch)
...@@ -1383,11 +1383,10 @@ def new_xtrain(dataset_description, ...@@ -1383,11 +1383,10 @@ def new_xtrain(dataset_description,
break break
model = new_train_epoch(model, model = new_train_epoch(model,
epoch, monitor,
training_loader, training_loader,
optimizer, optimizer,
scheduler, scheduler,
training_opts["log_interval"],
device, device,
scaler=scaler scaler=scaler
) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment