diff --git a/python/mxnet/gluon/data/dataloader.py b/python/mxnet/gluon/data/dataloader.py index 10de86099d04..68412267da6b 100644 --- a/python/mxnet/gluon/data/dataloader.py +++ b/python/mxnet/gluon/data/dataloader.py @@ -572,6 +572,7 @@ def __init__(self, dataset, batch_size=None, shuffle=False, sampler=None, self._pin_device_id = pin_device_id self._thread_pool = thread_pool self._timeout = timeout + assert timeout > 0, "timeout must be positive, given {}".format(timeout) if batch_sampler is None: if batch_size is None: