Display results for one sample prediction

I decided to follow the steps from the first tutorial. I tried to predict output for only one picture, but I’ve only got something with tensor. I don’t know what it is.

I read on some threads that this is the class, which it belongs to and the rest are the predictions for every label. Is there a way to convert it to a more visual way?


(Category tensor(33),
tensor([1.5564e-01, 3.9526e-02, 1.1031e-04, 3.4905e-04, 1.3358e-03, 1.1689e-03,
8.2174e-02, 5.6140e-05, 1.4628e-03, 9.4156e-05, 9.5288e-05, 1.3874e-04,
2.9548e-03, 7.6530e-04, 5.3943e-04, 2.3488e-01, 3.1597e-04, 2.3862e-03,
8.4716e-05, 2.9317e-05, 1.1785e-04, 3.1248e-05, 1.1121e-04, 2.9346e-03,
2.8736e-06, 1.9130e-05, 1.4326e-04, 2.6213e-06, 1.4470e-03, 3.1161e-05,
6.7871e-03, 6.7637e-05, 2.7770e-05, 4.6307e-01, 2.2835e-04, 1.2616e-04,

check the step 3 in below.
You can see you have three things. Catergory 33, tensor 33, and the tensor matrix.

  1. The first one is the array with the catergory name. For example,33 catergory and the first one is white dog.
  2. The second one in these 3 things is the one hot vector.
  3. The last one, which the tensor matrix, is the image if you are predicting image.

See the step 3 also use predict(img)? It is the same way as how you use.
Again, pred_class, pred_idx, outputs. #check those 1, 2 and 3 in above.

Need more help? Please reply in below or tag someone.
referees to Lesson 1. How to use saved model?

1 Like

Thanks, I will reply if I have further questions :slight_smile: