File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,13 @@ def run_benchmark(model, args):
179
179
outs = train_exe .run (
180
180
feed = {"pixel" : img_data ,
181
181
"label" : y_data },
182
- fetch_list = [avg_cost .name , batch_acc .name , batch_size_tensor .name ]
182
+ fetch_list = [
183
+ avg_cost .name , batch_acc .name , batch_size_tensor .name
184
+ ]
183
185
) # The accuracy is the accumulation of batches, but not the current batch.
184
- accuracy .update (value = np .array (np .mean (outs [1 ])), weight = np .mean (np .array (outs [2 ])))
186
+ accuracy .update (
187
+ value = np .array (np .mean (outs [1 ])),
188
+ weight = np .mean (np .array (outs [2 ])))
185
189
iters += 1
186
190
num_samples += len (y_data )
187
191
loss = np .mean (np .array (outs [0 ]))
Original file line number Diff line number Diff line change @@ -268,7 +268,9 @@ def test(exe):
268
268
loss , acc , weight = train_exe .run (
269
269
feed = {'data' : image ,
270
270
'label' : label },
271
- fetch_list = [avg_cost .name , batch_acc .name , batch_size_tensor .name ])
271
+ fetch_list = [
272
+ avg_cost .name , batch_acc .name , batch_size_tensor .name
273
+ ])
272
274
iters += 1
273
275
num_samples += len (label )
274
276
accuracy .add (value = np .array (np .mean (acc )), weight = np .mean (weight ))
You can’t perform that action at this time.
0 commit comments