pytorch-CycleGAN-and-pix2pix icon indicating copy to clipboard operation
pytorch-CycleGAN-and-pix2pix copied to clipboard

Sum total time of training in each model

Open rickkk856 opened this issue 3 years ago • 1 comments

Loss logs brings us something like this:

(epoch: 355, iters: 100, time: 0.078, data: 3.094) G_GAN: 18.230 G_L1: 12.882 D_real: 0.001 D_fake: 0.000
(epoch: 355, iters: 200, time: 0.062, data: 0.000) G_GAN: 16.719 G_L1: 19.293 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 300, time: 0.078, data: 0.000) G_GAN: 17.066 G_L1: 18.578 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 400, time: 1.156, data: 0.016) G_GAN: 14.722 G_L1: 11.785 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 500, time: 0.078, data: 0.000) G_GAN: 19.073 G_L1: 13.787 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 600, time: 0.080, data: 0.000) G_GAN: 9.353 G_L1: 19.723 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 700, time: 0.078, data: 0.000) G_GAN: 14.634 G_L1: 21.536 D_real: 0.000 D_fake: 0.000
(epoch: 355, iters: 800, time: 0.094, data: 0.000) G_GAN: 15.715 G_L1: 7.651 D_real: 0.000 D_fake: 0.000

and while training we see:

saving the model at the end of epoch 355, iters 800
End of epoch 355 / 400   Time Taken: 88 sec

But how can I calculate the time training in time: from the loss_logs.txt ? Are these values 0.078 + 0.062 + 0.078 + 1.156 + 0.078 + 0.080 + 0.078 + 0.094 = 1,704... is it in seconds, minutes, hours? should I multiply it by the time taken on each data inter?

IS IT POSSIBLE?

Or by now the best way to calculate the training time would be "Time Taken: 88 sec * Total Epoch of Training"

rickkk856 avatar Mar 25 '21 06:03 rickkk856

Hi!

If you go to visualizer.py, the print_current_losses() function describes what metrics are being printed.

This function is referenced in the main training loop at train.py, and the times are measured using time.time(), which measures time in seconds.

Hope this answers your question!

fork-while-1 avatar Apr 25 '22 21:04 fork-while-1