You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried running this script and an error was raised.
RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1, 1] because the unspecified dimension size -1 can be any value and is ambiguous
I actually have been trying using Opacus for other model that require multiple optimizers, using either plain PyTorch or Lightning, and have always failed so far. I can run Opacus with PyTorch Lightning (using a Callback) only when there is one optimizer.
🐛 Bug
I tried running this script and an error was raised.
I actually have been trying using Opacus for other model that require multiple optimizers, using either plain PyTorch or Lightning, and have always failed so far. I can run Opacus with PyTorch Lightning (using a Callback) only when there is one optimizer.
Expected behavior
No error is raised.
An example with simple model using two optimizers
This will work because of manual optimization.
However, if I switch to automatic optimization, it will crash. To switch to automatic optimization, do the following:
Set this in the model
Change the training_step
Environment
The text was updated successfully, but these errors were encountered: