File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -671,8 +671,8 @@ def switch_batch(engine):
671671 if max_epochs is not None :
672672 if max_epochs < self .state .epoch :
673673 raise ValueError (
674- "Argument max_epochs should be larger than the start epoch "
675- f"defined in the state: { max_epochs } vs { self .state .epoch } . "
674+ "Argument max_epochs should be greater than or equal to the start "
675+ f"epoch defined in the state: { max_epochs } vs { self .state .epoch } . "
676676 "Please, set engine.state.max_epochs = None "
677677 "before calling engine.run() in order to restart the training from the beginning."
678678 )
Original file line number Diff line number Diff line change @@ -1207,7 +1207,7 @@ def check_iter_epoch(first_epoch_iter):
12071207 assert engine .state .iteration == 7 * real_epoch_length
12081208
12091209 # error
1210- with pytest .raises (ValueError , match = "Argument max_epochs should be larger than the start epoch" ):
1210+ with pytest .raises (ValueError , match = "Argument max_epochs should be greater than or equal to the start epoch" ):
12111211 engine .run (data , max_epochs = 4 , epoch_length = epoch_length )
12121212
12131213 # restart from 0 to 7 (As state.epoch == max_epochs(=7),
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def test_load_state_dict_with_params_overriding_integration():
144144 assert state .iteration == state_dict ["epoch_length" ] * new_max_epochs
145145 assert state .epoch == new_max_epochs
146146
147- with pytest .raises (ValueError , match = r"Argument max_epochs should be larger than the start epoch" ):
147+ with pytest .raises (ValueError , match = r"Argument max_epochs should be greater than or equal to the start epoch" ):
148148 engine .load_state_dict (state_dict )
149149 engine .run (data , max_epochs = 3 )
150150
@@ -270,7 +270,7 @@ def test_restart_training():
270270 state = engine .run (data , max_epochs = 5 )
271271 with pytest .raises (
272272 ValueError ,
273- match = r"Argument max_epochs should be larger than the start epoch defined in the state: 2 vs 5. "
273+ match = r"Argument max_epochs should be greater than or equal to the start epoch defined in the state: 2 vs 5. "
274274 r"Please, .+ "
275275 r"before calling engine.run\(\) in order to restart the training from the beginning." ,
276276 ):
You can’t perform that action at this time.
0 commit comments