rahul003 commented on a change in pull request #10435: [MXNET-289] Allow specifying number of batches to run in an epoch to fix hang in dist sync for last epoch URL: https://github.com/apache/incubator-mxnet/pull/10435#discussion_r179958665
########## File path: python/mxnet/module/base_module.py ########## @@ -511,9 +514,12 @@ def fit(self, train_data, eval_data=None, eval_metric='acc', self.forward_backward(data_batch) self.update() try: - # pre fetch next batch - next_data_batch = next(data_iter) - self.prepare(next_data_batch, sparse_row_id_fn=sparse_row_id_fn) + if epoch_size and (nbatch == epoch_size - 1): Review comment: No, this is an argument that allows early stopping of loop in a way because different machines can have different number of samples. It can't run into an infinite loop. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services