python - 如何使用静态转发方法制作新型 autograd 函数。?
问题描述
错误是:
Traceback (most recent call last):
File "<ipython-input-5-401374f4bdee>", line 39, in <module>
frame = detect(frame, net.eval(), transform)
File "<ipython-input-5-401374f4bdee>", line 14, in detect
y = net(x)
File "C:\Users\kusha\anaconda3\envs\virtual_platform\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\kusha\OneDrive\Desktop\Computer_Vision_A_Z_Template_Folder\Module 2 - Object Detection\ssd.py", line 101, in forward
self.priors.type(type(x.data)) # default boxes
File "C:\Users\kusha\anaconda3\envs\virtual_platform\lib\site-packages\torch\autograd\function.py", line 145, in __call__
"Legacy autograd function with non-static forward method is deprecated. "
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)
我已经尝试了错误中说明的 autograd 函数的 PyTorch 文档作为示例链接,但它没有锻炼
解决方案
推荐阅读
- reactjs - 我应该如何在 React 中流式传输大型本地视频文件?
- javascript - webdriverio测试可以在Unix上执行吗
- android - 无法解析 android 应用程序模块的
- python - Web3-Py:Nonce 事务覆盖问题
- javascript - Tailwind.min.css 在我的 Nuxt 应用程序中覆盖 tailwind.css
- mysql - 如何在我的组合框 vb.net 上使用月份过滤我的表格
- python - Python - 如何过滤数据框以仅保留一种产品的订单号?
- sql - 在 SQL 中将不同的日期格式转换为相同的日期格式?
- node.js - 在 Ubuntu 上用 Wine 运行节点
- javascript - 是什么导致此错误不断出现以及如何防止它继续发生