File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -167,10 +167,11 @@ def main(cfg: DictConfig) -> None:
167
167
batches_done = (epoch - 1 ) * len (train_dataloader ) + (batch_i - 1 )
168
168
batches_left = cfg .train .num_epochs * len (train_dataloader ) - batches_done
169
169
time_left = datetime .timedelta (seconds = batches_left * timer .seconds ())
170
+ time_iter = round (timer .seconds (), 3 )
170
171
timer .reset ()
171
172
172
173
logger .info (
173
- f'Training - [Epoch: { epoch } /{ cfg .train .num_epochs } ] [Batch: { batch_i } /{ len (train_dataloader )} ] [Loss: { np .mean (epoch_metrics ["loss" ]):.3f} ] [Acc: { np .mean (epoch_metrics ["acc" ]):.3f} ] [ETA: { time_left } ]'
174
+ f'Training - [Epoch: { epoch } /{ cfg .train .num_epochs } ] [Batch: { batch_i } /{ len (train_dataloader )} ] [Loss: { np .mean (epoch_metrics ["loss" ]):.3f} ] [Acc: { np .mean (epoch_metrics ["acc" ]):.3f} ] [ETA: { time_left } ] [Iter time: { time_iter } s/it] '
174
175
)
175
176
176
177
# Empty cache
@@ -208,11 +209,12 @@ def test_model(epoch):
208
209
batches_done = batch_i - 1
209
210
batches_left = len (test_dataloader ) - batches_done
210
211
time_left = datetime .timedelta (seconds = batches_left * timer .seconds ())
212
+ time_iter = round (timer .seconds (), 3 )
211
213
timer .reset ()
212
214
213
215
# Log test performance
214
216
logger .info (
215
- f'Testing - [Epoch: { epoch } /{ cfg .train .num_epochs } ] [Batch: { batch_i } /{ len (test_dataloader )} ] [Loss: { np .mean (test_metrics ["loss" ]):.3f} ] [Acc: { np .mean (test_metrics ["acc" ]):.3f} ] [ETA: { time_left } ]'
217
+ f'Testing - [Epoch: { epoch } /{ cfg .train .num_epochs } ] [Batch: { batch_i } /{ len (test_dataloader )} ] [Loss: { np .mean (test_metrics ["loss" ]):.3f} ] [Acc: { np .mean (test_metrics ["acc" ]):.3f} ] [ETA: { time_left } ] [Iter time: { time_iter } s/it] '
216
218
)
217
219
218
220
writer .add_scalar ("test/loss" , np .mean (test_metrics ["loss" ]), epoch )
You can’t perform that action at this time.
0 commit comments