locuslab / mpc.pytorch

A fast and differentiable model predictive control (MPC) solver for PyTorch.
https://locuslab.github.io/mpc.pytorch/
MIT License
872 stars 146 forks source link

RuntimeError: Legacy autograd function with non-static forward method is deprecated. #33

Closed Meruem10 closed 2 years ago

Meruem10 commented 3 years ago

Dear all,

Running the example notebooks (Time-Varying Linear Control or Pendulum), I get the following error:

RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)

Does anybody know how to resolve this issue?

Thank you in advance!

Meruem10 commented 3 years ago

I just saw, that an issue has already been opened for the same issue here: https://github.com/locuslab/mpc.pytorch/issues/28

Sorry for the duplicate!

bamos commented 2 years ago

Updated in https://github.com/locuslab/mpc.pytorch/commit/bf19cd4405d8242e93f4c0a5464739f98798a833