File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 85
85
acc = correct * 1.0 / len (data )
86
86
print ('Train Epoch: {} [{}/{}] Loss: {:.6f} Acc: {:.4f} lr: {:.2e}' .format (
87
87
epoch , batch_idx * len (data ), len (train_loader .dataset ),
88
- loss .data [ 0 ] , acc , optimizer .param_groups [0 ]['lr' ]))
88
+ loss .data , acc , optimizer .param_groups [0 ]['lr' ]))
89
89
90
90
elapse_time = time .time () - t_begin
91
91
speed_epoch = elapse_time / (epoch + 1 )
105
105
data , target = data .cuda (), target .cuda ()
106
106
data , target = Variable (data , volatile = True ), Variable (target )
107
107
output = model (data )
108
- test_loss += F .cross_entropy (output , target ).data [ 0 ]
108
+ test_loss += F .cross_entropy (output , target ).data
109
109
pred = output .data .max (1 )[1 ] # get the index of the max log-probability
110
110
correct += pred .cpu ().eq (indx_target ).sum ()
111
111
You can’t perform that action at this time.
0 commit comments