Skip to content

Commit

Permalink
Pytorch DataLoader do not have a reset() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
peerschuett committed Jan 21, 2021
1 parent a2ab360 commit 19dc805
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion latticenet_py/callbacks/state_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ def phase_started(self, phase, **kwargs):
phase.samples_processed_this_epoch=0

def phase_ended(self, phase, **kwargs):
phase.loader.reset()

if(type(phase.loader) == torch.utils.data.DataLoader): # pytorchs dataloder has no reset
pass
else:
phase.loader.reset()

0 comments on commit 19dc805

Please sign in to comment.