Skip to content

Commit a428e29

Browse files
committed
Don't increment batch progress in eval loop with inf max batch
1 parent caeea6e commit a428e29

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lightning/pytorch/loops/evaluation_loop.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
import math
1415
import os
1516
import shutil
1617
import sys
@@ -268,7 +269,10 @@ def increment_progress_to_evaluation_end(self) -> None:
268269
if self.skip:
269270
return
270271
self.reset()
271-
max_batch = int(max(self.max_batches))
272+
max_batch = max(self.max_batches)
273+
if isinstance(max_batch, float) and math.isinf(max_batch):
274+
return
275+
max_batch = int(max_batch)
272276
if max_batch == -1:
273277
return
274278
self.batch_progress.increment_by(max_batch, True)

0 commit comments

Comments
 (0)