Skip to content

Commit 544ff91

Browse files
Wanglongzhi2001Oceania2018
authored andcommitted
Fix model.evaluate don't have output
1 parent 89fe0bb commit 544ff91

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/TensorFlowNET.Core/Keras/Engine/ICallback.cs

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ public interface ICallback
1313
void on_predict_batch_end(long end_step, Dictionary<string, Tensors> logs);
1414
void on_predict_end();
1515
void on_test_begin();
16+
void on_test_batch_begin(long step);
1617
void on_test_batch_end(long end_step, IEnumerable<(string, Tensor)> logs);
1718
}

src/TensorFlowNET.Keras/Engine/Model.Evaluate.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ public void evaluate(NDArray x, NDArray y,
7272

7373
foreach (var step in data_handler.steps())
7474
{
75-
callbacks.on_train_batch_begin(step);
75+
callbacks.on_test_batch_begin(step);
7676
logs = test_function(data_handler, iterator);
7777
var end_step = step + data_handler.StepIncrement;
7878
callbacks.on_test_batch_end(end_step, logs);
7979
}
8080
}
81+
Console.WriteLine();
8182
GC.Collect();
8283
GC.WaitForPendingFinalizers();
8384
}

0 commit comments

Comments
 (0)