cogsys-tuebingen / mobilestereonet

Lightweight stereo matching network based on MobileNet blocks
Apache License 2.0
240 stars 47 forks source link

Legacy autograd function with non-static forward method is deprecated #8

Closed blackHorz closed 3 years ago

blackHorz commented 3 years ago

Hi, i am using Cuda11.1 and encountered 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)

def make_nograd_func(func): def wrapper(*f_args, *f_kwargs): with torch.no_grad(): ret = func(f_args, **f_kwargs) return ret return wrapper

This is the function that throws the error while calling func()

blackHorz commented 3 years ago

Okay it has been resolved now.