用PyTorch跑旧模型代码时候报错:
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
本文介绍在PyTorch中遇到的关于Autograd非静态forward方法的错误,并提供了具体的解决方案,包括如何修改forward方法及调用方式。
用PyTorch跑旧模型代码时候报错:
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
2357
1万+
1万+
2975
4043
3076
1059
1336
443

被折叠的 条评论
为什么被折叠?