Closed rraminen closed 4 years ago
Check out this pull request on
Review Jupyter notebook visual diffs & provide feedback on notebooks.
Powered by ReviewNB
Hi, @rraminen I have run the same error, and found this PR. Maybe you did, I wanted to find out why this error occur. And I tested as you suggested, resulting in no difference between two versions. you can check what I did here
you can message me, and my fastai forum username is spellonyou
,
would be pleased to getting an answer & making studymate 🙌
Hi @SpellOnYou ,
Try using .item() to see the actual values in each of the variables in two different versions. For example p[99].item(). Let me know if you don't see different values. Thanks, Ramya
IndexError: index 3 is out of bounds for dimension 0 with size 3
torch.linspace() behaviour differs in different PyTorch versions. For example, for T = torch.linspace(0.01, 1, 100), value of T[99] is 0.99XXXXXX in version 1.4.0 value of T[99] is 1 in torch versions > 1.4.0
Hence modified the function def _inner() by adding 'if idx == 2: idx = 1' to work as expected.
For lay people who don't know what to do with this error in a Jupyter Notebook, can you tell me what I should do, step by step, to prevent this error?
Thank you!
IndexError: index 3 is out of bounds for dimension 0 with size 3
torch.linspace() behaviour differs in different PyTorch versions. For example, for T = torch.linspace(0.01, 1, 100), value of T[99] is 0.99XXXXXX in version 1.4.0 value of T[99] is 1 in torch versions > 1.4.0
Hence modified the function def _inner() by adding 'if idx == 2: idx = 1' to work as expected.