@@ -85,8 +85,8 @@ def parse_args():
85
85
help = 'If set, use nvprof for CUDA.' )
86
86
parser .add_argument (
87
87
'--no_test' ,
88
- action = 'store_false ' ,
89
- help = 'If set, test the testset during training.' )
88
+ action = 'store_true ' ,
89
+ help = 'If set, do not test the testset during training.' )
90
90
parser .add_argument (
91
91
'--memory_optimize' ,
92
92
action = 'store_true' ,
@@ -229,9 +229,9 @@ def train(avg_loss, infer_prog, optimizer, train_reader, test_reader, batch_acc,
229
229
print ("Pass: %d, Iter: %d, Loss: %f\n " %
230
230
(pass_id , iters , np .mean (train_losses )))
231
231
print_train_time (start_time , time .time (), num_samples )
232
- print ("Pass: %d, Loss: %f" % (pass_id , np .mean (train_losses )))
232
+ print ("Pass: %d, Loss: %f" % (pass_id , np .mean (train_losses ))),
233
233
# evaluation
234
- if not args .no_test and batch_acc != None :
234
+ if not args .no_test and batch_acc :
235
235
pass_test_acc = test (exe , infer_prog , test_reader , feeder ,
236
236
batch_acc )
237
237
print (", Test Accuracy: %f" % pass_test_acc )
@@ -310,7 +310,7 @@ def train_parallel(avg_loss, infer_prog, optimizer, train_reader, test_reader,
310
310
print ("Pass %d, batch %d, loss %s" %
311
311
(pass_id , batch_id , np .array (loss )))
312
312
print_train_time (start_time , time .time (), num_samples )
313
- if not args .no_test and batch_acc != None :
313
+ if not args .no_test and batch_acc :
314
314
test_acc = test (startup_exe , infer_prog , test_reader , feeder ,
315
315
batch_acc )
316
316
print ("Pass: %d, Test Accuracy: %f\n " % (pass_id , test_acc ))
0 commit comments