Error in returning Dict
from training_step
with multiple GPUs
#6193
Labels
bug
Something isn't working
distributed
Generic distributed-related topic
good first issue
Good for newcomers
help wanted
Open to be worked on
priority: 0
High priority task
🐛 Bug
When using multiple GPUs with 'dp', the error
RuntimeError: grad can be implicitly created only for scalar outputs
occurs if I utilizedtraining_step
function like this:Please reproduce using the BoringModel
https://colab.research.google.com/drive/1hmHqYHPOqDlZUAF7-9zcCvobrvSPt7W5?usp=sharing
Expected behavior
It is supposed to work fine to return
Dict
withloss
key.A quick solution
Return loss tensor directly from
training_step
function:Environment
cc. @carmocca
The text was updated successfully, but these errors were encountered: