@@ -2272,7 +2272,7 @@ def test_checkpoint(self):
22722272 self .assertTrue (osp .exists (path ))
22732273 self .assertFalse (osp .exists (osp .join (self .temp_dir , 'epoch_4.pth' )))
22742274
2275- ckpt = torch .load (path )
2275+ ckpt = torch .load (path , weights_only = False )
22762276 self .assertEqual (ckpt ['meta' ]['epoch' ], 3 )
22772277 self .assertEqual (ckpt ['meta' ]['iter' ], 12 )
22782278 self .assertEqual (ckpt ['meta' ]['experiment_name' ],
@@ -2444,7 +2444,7 @@ def test_checkpoint(self):
24442444 self .assertTrue (osp .exists (path ))
24452445 self .assertFalse (osp .exists (osp .join (self .temp_dir , 'epoch_13.pth' )))
24462446
2447- ckpt = torch .load (path )
2447+ ckpt = torch .load (path , weights_only = False )
24482448 self .assertEqual (ckpt ['meta' ]['epoch' ], 0 )
24492449 self .assertEqual (ckpt ['meta' ]['iter' ], 12 )
24502450 assert isinstance (ckpt ['optimizer' ], dict )
@@ -2455,7 +2455,7 @@ def test_checkpoint(self):
24552455 self .assertEqual (message_hub .get_info ('iter' ), 11 )
24562456 # 2.1.2 check class attribute _statistic_methods can be saved
24572457 HistoryBuffer ._statistics_methods .clear ()
2458- ckpt = torch .load (path )
2458+ ckpt = torch .load (path , weights_only = False )
24592459 self .assertIn ('min' , HistoryBuffer ._statistics_methods )
24602460
24612461 # 2.2 test `load_checkpoint`
0 commit comments