You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/10/21 03:27:23 UTC
[GitHub] nickeleres opened a new issue #8370: Training set NDArrayIter empty after first epoch
nickeleres opened a new issue #8370: Training set NDArrayIter empty after first epoch
URL: https://github.com/apache/incubator-mxnet/issues/8370
The code contained within the loop `for i, batch in enumerate(train_data):` is only run once, which I assume is because for some reason `train_data` is empty after the first full pass thru the data (first epoch).
Am I missing a flag somewhere? Why would this be happening?
```
epochs = 10
for e in range(epochs):
print 'Epoch:', e, 'train_data', enumerate(train_data)
for i, batch in enumerate(train_data):
print 'epoch', e, 'batch_number', i, 'train_data', train_data
data = batch.data[0]
label = batch.label[0]
with autograd.record(): # Start recording the derivatives
output = net(data) # the forward iteration
loss = softmax_cross_entropy(output, label)
epoch_loss = loss.asnumpy().sum()/batch_size
loss.backward()
trainer.step(data.shape[0])
```
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services