RuntimeError:不推荐使用具有非静态转发方法的旧版autograd函数

问题描述

我正在构建“单发多盒检测”项目,用于对mp4视频中的流浪狗进行目标检测

我正在按照此教程进行操作,并已向讲师发了消息。

当我在Spyder中运行代码时,这是一个完整的错误

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)

这是我的代码

enter image description here

我也已与7月8日对此问题的上一个质询者一起检查了Pytorch文档。

https://pytorch.org/tutorials/beginner/examples_autograd/two_layer_net_custom_function.html

我是深度学习的初学者,并且确定我犯了一个错误

我将非常感谢您的帮助。

干杯

瑞安

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)