ZeRO 3: IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
See original GitHub issueIf I use the following snippet in BingBERT example with ZeRO 3, I received IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) no matter if Transformer CUDA layer is enabled or not.
with deepspeed.zero.Init(remote_device='cpu', pin_memory=True, enabled=True):
model = BertMultiTask(args)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
RuntimeError: dimension out of range (expected to be in ...
The value of each element should be the 0-based target class ID. Here's an example. Suppose you have batch size B=2 , and...
Read more >dimension out of range (expected to be in range of [-1, 0], but ...
The way one calls NLLLoss is loss_fn(input, target) . Right now your input and target tensors don't have the right size. That being...
Read more >IndexError: Dimension out of range (expected to be in range of
It seems your code uses nn.CrossEntropyLoss (a custom implementation?) at one point, which calls into F.log_softmax(input, dim) . The input ...
Read more >[Solved][PyTorch] IndexError: Dimension out of range ...
Today I got an error message as following (In a team project source code): "IndexError: Dimension out of range (expected to be in...
Read more >PyTorch Dimension out of range (expected to be in range of
... 0], but got 1). deep-learningmachine-learningpython-3.xpytorch ... IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tjruwase
I was using an older version where there are no these two lines