From 475ef1ad23a09ba22b02699d4ec6d73f462e8db4 Mon Sep 17 00:00:00 2001 From: Otthorn Date: Fri, 30 Apr 2021 11:46:53 +0200 Subject: [PATCH] Use tqdm.write in order to not break progress bar --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 955fa95..8c1acf2 100644 --- a/main.py +++ b/main.py @@ -526,7 +526,7 @@ for iteration in range(n_iter): # In case we reached the last 75% of iterations, # decrease the learning rate of the optimizer 10-fold. if iteration == round(n_iter * 0.75): - print("Decreasing LR 10-fold ...") + tqdm.write("Decreasing LR 10-fold ...") optimizer = torch.optim.Adam( neural_radiance_field.parameters(), lr=lr * 0.1 ) @@ -596,7 +596,7 @@ for iteration in range(n_iter): # Every 10 iterations, print the current values of the losses. if iteration % 10 == 0: - print( + tqdm.write( f"Iteration {iteration:05d}:" + f" loss color = {float(color_err):1.2e}" + f" loss silhouette = {float(sil_err):1.2e}"