@@ -197,6 +197,7 @@ def _get_lightning_trainer(
197197
198198
199199class TestLightningCheckpoint (TestLightningCheckpoint ):
200+ @skip_if_no_network
200201 def test_load_resume_parity_with_mmf (self ):
201202 # with checkpoint.resume = True, by default it loads "current.ckpt"
202203 self ._load_checkpoint_and_test ("current.ckpt" , ckpt_config = {"resume" : True })
@@ -208,6 +209,7 @@ def test_load_resume_best_parity_with_mmf(self):
208209 "best.ckpt" , ckpt_config = {"resume" : True , "resume_best" : True }
209210 )
210211
212+ @skip_if_no_network
211213 def test_load_resume_ignore_resume_zoo (self ):
212214 # specifying both checkpoint.resume = True and resume_zoo
213215 # resume zoo should be ignored. It should load the "current.ckpt"
@@ -393,7 +395,8 @@ def test_load_trainer_ckpt_number_of_steps(self):
393395 )
394396 self .assertEquals (lightning .trainer .global_step , 12 )
395397 call_args_list = [l [0 ][4 ] for l in mock_method .call_args_list ]
396- self .assertListEqual (list (range (0 , 6 )), call_args_list )
398+ # in lightning 1.6.0 last batch idx from ckpt is repeated
399+ self .assertListEqual (list (range (5 , 11 )), call_args_list )
397400
398401 def test_trainer_save_current_parity_with_mmf (self ):
399402 with mock_env_with_temp (
@@ -454,7 +457,7 @@ def test_lightning_checkpoint_interval(self):
454457 files = os .listdir (os .path .join (tmp_d , "models" ))
455458 self .assertEquals (3 , len (files ))
456459 indexes = {int (x [:- 5 ].split ("=" )[1 ]) for x in files }
457- self .assertSetEqual ({1 , 3 , 5 }, indexes )
460+ self .assertSetEqual ({2 , 4 , 6 }, indexes )
458461
459462 def _get_mmf_ckpt (self , filename , ckpt_config = None ):
460463 with mock_env_with_temp (
@@ -508,12 +511,7 @@ def _load_checkpoint_and_test(self, filename, ckpt_config=None):
508511
509512 # Make sure lightning and mmf parity
510513 self ._assert_same_dict (mmf_ckpt ["model" ], lightning_ckpt ["state_dict" ])
511-
512- # different case for best checkpoint, see D34398730
513- if "resume_best" in ckpt_config and ckpt_config ["resume_best" ]:
514- self .assertEquals (mmf_ckpt ["current_epoch" ], lightning_ckpt ["epoch" ] + 1 )
515- else :
516- self .assertEquals (mmf_ckpt ["current_epoch" ], lightning_ckpt ["epoch" ])
514+ self .assertEquals (mmf_ckpt ["current_epoch" ], lightning_ckpt ["epoch" ] + 1 )
517515 self .assertEquals (mmf_ckpt ["num_updates" ], lightning_ckpt ["global_step" ])
518516 self ._assert_same_dict (
519517 mmf_ckpt ["optimizer" ], lightning_ckpt ["optimizer_states" ][0 ]
0 commit comments