Skip to content

Commit d053113

Browse files
committed
fixed for windows
1 parent f2ebd8a commit d053113

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tutorial-contents/305_batch_train.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@
2424
num_workers=2, # subprocesses for loading data
2525
)
2626

27-
for epoch in range(3): # train entire dataset 3 times
28-
for step, (batch_x, batch_y) in enumerate(loader): # for each training step
29-
# train your data...
30-
print('Epoch: ', epoch, '| Step: ', step, '| batch x: ',
31-
batch_x.numpy(), '| batch y: ', batch_y.numpy())
27+
28+
def show_batch():
29+
for epoch in range(3): # train entire dataset 3 times
30+
for step, (batch_x, batch_y) in enumerate(loader): # for each training step
31+
# train your data...
32+
print('Epoch: ', epoch, '| Step: ', step, '| batch x: ',
33+
batch_x.numpy(), '| batch y: ', batch_y.numpy())
34+
35+
36+
if __name__ == '__main__':
37+
show_batch()
38+

0 commit comments

Comments
 (0)