@@ -2271,7 +2271,7 @@ def test_checkpoint(self):
22712271 self .assertTrue (osp .exists (path ))
22722272 self .assertFalse (osp .exists (osp .join (self .temp_dir , 'epoch_4.pth' )))
22732273
2274- ckpt = torch .load (path )
2274+ ckpt = torch .load (path , weights_only = False )
22752275 self .assertEqual (ckpt ['meta' ]['epoch' ], 3 )
22762276 self .assertEqual (ckpt ['meta' ]['iter' ], 12 )
22772277 self .assertEqual (ckpt ['meta' ]['experiment_name' ],
@@ -2445,7 +2445,7 @@ def test_checkpoint(self):
24452445 self .assertTrue (osp .exists (path ))
24462446 self .assertFalse (osp .exists (osp .join (self .temp_dir , 'epoch_13.pth' )))
24472447
2448- ckpt = torch .load (path )
2448+ ckpt = torch .load (path , weights_only = False )
24492449 self .assertEqual (ckpt ['meta' ]['epoch' ], 0 )
24502450 self .assertEqual (ckpt ['meta' ]['iter' ], 12 )
24512451 assert isinstance (ckpt ['optimizer' ], dict )
@@ -2456,7 +2456,7 @@ def test_checkpoint(self):
24562456 self .assertEqual (message_hub .get_info ('iter' ), 11 )
24572457 # 2.1.2 check class attribute _statistic_methods can be saved
24582458 HistoryBuffer ._statistics_methods .clear ()
2459- ckpt = torch .load (path )
2459+ ckpt = torch .load (path , weights_only = False )
24602460 self .assertIn ('min' , HistoryBuffer ._statistics_methods )
24612461
24622462 # 2.2 test `load_checkpoint`
0 commit comments