1
$\begingroup$

Bug introduced in 11.3 and fixed in 12.0.0

I'm on Mathematica 11.3, Classify model could use TopProbabilities without designating an integer.

img=Import["https://i.stack.imgur.com/4MHkf.png"]
model=NetModel["VGG-16 Trained on ImageNet Competition Data"]
model[img,"TopProbabilities"]

How to solve this?

enter image description here

enter image description here

$\endgroup$
  • 3
    $\begingroup$ You should post actual code instead of images of code. The message with the Rule is clearly a bug, and bugs should be reported to WRI. You seem to have found a workaround for this bug, but I would still recommend reporting it. $\endgroup$ – Jason B. Nov 21 '18 at 20:18
4
$\begingroup$

Fixed in Version 12, or upgrade your NeuralNetworks Framework.

PacletUpdate["NeuralNetworks"]

enter image description here

Remark:

This was caused by some bug in 11.3's decoder function.

In /Decoder/Classes.m, find function topProbs[labels_] and modify the return from

Map[Thread@*Apply[Rule], labelsValues, {-3}] 

to

Map[Thread@*Apply[Rule], labelsValues, {Depth[input] - 2}] 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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