Skip to content

Commit

Permalink
fix val
Browse files Browse the repository at this point in the history
  • Loading branch information
meijieru committed May 29, 2017
1 parent 6781643 commit e974c68
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crnn_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def val(net, dataset, criterion, max_iter=100):
n_correct = 0
loss_avg = utils.averager()

for i in range(max_iter):
for i in range(min(max_iter, len(data_loader))):
data = val_iter.next()
i += 1
cpu_images, cpu_texts = data
Expand Down Expand Up @@ -168,9 +168,6 @@ def val(net, dataset, criterion, max_iter=100):
print('Test loss: %f, accuray: %f' % (loss_avg.val(), accuracy))


# val(crnn, test_dataset, criterion)
# exit(0)

def trainBatch(net, criterion, optimizer):
data = train_iter.next()
cpu_images, cpu_texts = data
Expand Down

0 comments on commit e974c68

Please sign in to comment.