Search code examples
cntk

TypeError: cannot convert key of dictionary on call to prediction?


I'm trying to do 10 test predictions similar to the code in the CNTK_103B_MNIST_FeedForwardNetwork tutorial, but I'm getting an error as shown below. What could be the problem with my code?

Code / Error Message

enter image description here


Solution

  • To answer my own question. I used the incorrect name of the CNTK input_variable in the model.

    I changed this line of code:

    predicted_label_prob = pred_basic_model.eval({input : x})
    

    to

    predicted_label_prob = pred_basic_model.eval({pred_basic_model.arguments[0] : x})
    

    and now it works.