Section 5 lesson 128 getting pred_classes tensor of all 2s after using argmax(dim=1) #500
Replies: 2 comments 2 replies
-
Hi again, |
Beta Was this translation helpful? Give feedback.
-
Hi @AxisMeetsWorld , These errors are tricky to track down. I'd say it could be your random seed setup or how your model is learning (in this case, I'd check the forward/backward pass/loss values during training/testing). I just ran the 03 notebook end-to-end and got the same original results: https://colab.research.google.com/drive/17uginhratDnDw9c10iH51molxbJprg9m?usp=sharing # Turn the prediction probabilities into prediction labels by taking the argmax()
pred_classes = pred_probs.argmax(dim=1)
pred_classes Output:
It will also sometimes be dependent on what hardware you're using (though not too dependent) - are you running it in Google Colab? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @mrdbourke,
I was trying to follow along with the above mentioned exercise and I tried to look at what you had here and I couldn't figure out why after calling the following lines I was getting nothing but a tensor of 2s as opposed to what you got:
The result was: tensor([2, 2, 2, 2, 2, 2, 2, 2, 2])
where you seem to get tensor([5, 1, 7, 4, 3, 0, 4, 7, 1]) 😬
In the previous cells, I ran the following code, and I don't think there is anything different:
The next cell
Finally right before I called the suspect code (giving the 2s) I had
Any ideas on what I might be missing so that I can get some semblance of what you had? :
tensor([5, 1, 7, 4, 3, 0, 4, 7, 1]) as opposed to tensor([2, 2, 2, 2, 2, 2, 2, 2, 2])
Beta Was this translation helpful? Give feedback.
All reactions