Как мне сделать функцию автограда нового стиля с методом stati c forward.? - PullRequest
1 голос
/ 25 мая 2020

Ошибка:

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)

Я пробовал документацию PyTorch для функции автограда, указанной в ошибке в качестве ссылки для примера, но это не сработало

...