File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 15
15
# See the License for the specific language governing permissions and
16
16
# limitations under the License.
17
17
18
+ import datetime
18
19
import glob
19
20
import os
20
21
import sys
@@ -200,8 +201,10 @@ def on_epoch_start(self):
200
201
def on_epoch_end (self ):
201
202
if self .global_rank is None or self .global_rank == 0 :
202
203
step = self .step
203
- run_time = time .time () - self ._last_epoch_start
204
- logging .info (f"Finished epoch { self .epoch_num } in { run_time } " )
204
+
205
+ delta = datetime .timedelta (seconds = (time .time () - self ._last_epoch_start ))
206
+ logging .info (f"Finished epoch { self .epoch_num } in { delta } " )
207
+
205
208
if self ._swriter is not None :
206
209
value = self .epoch_num
207
210
self ._swriter .add_scalar ('misc/epoch' , value , step )
@@ -373,8 +376,6 @@ def on_epoch_start(self):
373
376
def on_epoch_end (self ):
374
377
if self ._epoch_freq > 0 :
375
378
if self .global_rank is None or self .global_rank == 0 :
376
- run_time = time .time () - self ._last_epoch_start
377
- logging .info (f'Finished epoch { self .epoch_num } in { run_time } ' )
378
379
if (self .epoch_num + 1 ) % self ._epoch_freq == 0 :
379
380
self .__save_to (path = self ._folder )
380
381
You can’t perform that action at this time.
0 commit comments