Closed luisquintanilla closed 5 years ago
Here is a workaround for now to use a custom function.
public static void DisplayMetrics(ImageClassificationMetrics metrics)
{
if(metrics.Train == null)
{
Console.WriteLine(metrics);
} else
{
TrainMetrics trainMetrics = metrics.Train;
Console.WriteLine($"Epoch: {trainMetrics.Epoch} | Accuracy {trainMetrics.Accuracy} | Loss: {trainMetrics.CrossEntropy}");
}
}
metricsCallback parameter is called during training phase and bottleneck phase. I have fixed the documentation. Thanks.
System information
Issue
Tried to provide a custom function for the
metricsCallback
parameter. The documentation in IntelliSense says this method is only called during the Training phase. However, it does not appear to be the case. If the Bottleneck phase has to happen (training for first time or not using cached bottleneck values), aSystem.NullReferenceException
is raised.I suspect this is because the same callback is used for both the Bottleneck / Training phases. It would be good to either:
a) Have separate callbacks depending on whether it's Bottleneck / Training phase. b) Allow the user to check which phase is currently taking place so they can display the results accordingly in their
metricsCallback
method.Note that once a model is trained and the Bottleneck phase no longer needs to happen since the cached values are being used, no Exceptions are raised and the application works as expected.
Source code / logs
Pipeline:
Metrics Callback Method: