I am following the example listed on this page ResNet 50 to train a custom classifier and inspect the outcome with ClassifierMeasurements. My training set has 443 images from more than 30 classes. The training with NetTrain progresses smoothly and results in a NetTrainResultsObject. When I try to call in the trained net with ClassifierMeasurements to compute accuracy the code returns a lot of errors.

ClassifierMeasurements[trainedNetIncV1["TrainedNet"], testingSet, "Accuracy"]

errors returned in the notebook

I am using v 12.2.0 on a linux box with GPU. This code has worked in the past with v12.1. PacletInstall["NeuralNetworks"] reports that I am running v 12.2.14 which seems to be the latest. I am not sure if something has changed between the versions specific to this task. I appreciate any help that can be provided.

Thank you

  • $\begingroup$ You may need to ask WRI support about this - the function appears to work fine on my machine. Perhaps running PacletInstall["NeuralNetworks"] might update the version on your machine to the latest version? $\endgroup$
    – Carl Lange
    Mar 14, 2021 at 13:37
  • $\begingroup$ Thanks! I checked the version with PacletInstall and it reports the latest version is already installed (12.2.14). I will reach out to them as well. $\endgroup$
    – bhopshang
    Mar 14, 2021 at 15:21

1 Answer 1


It turns out that this issue is known to WRI. From their technical support,

"ClassifierMeasurements is giving these messages when the MeanCrossEntropy is divergent. A simpler example that exhibits similar behavior is:"

ClassifierMeasurements[{<|"A" -> 0.9, "B" -> 0.1|>, <|"A" -> 0.8, "B" ->
0.2|>, <|"A" -> 0.2, "B" -> 0.8|>, <|"A" -> 0.6, "B" -> 0.4|>}, 
Table[RandomImage[], 4],"MeanCrossEntropy"]

I am closing this question and keeping this message here in case it helps someone else.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.