Skip to content

Fix RuntimeError: Legacy autograd function with non-static forward method is deprecated #89

Open

Description

@OceanWong1991

change face_ssd.py line 345 to:

         # output = self.detect(
               #   face_loc.view(face_loc.size(0), -1, 4),         # loc preds
               #   self.softmax(face_conf.view(face_conf.size(0), -1, self.num_classes)), # conf preds
               #   self.priors.type(type(x.data))                  # default boxes
               # )

               ###########################################################修改代码################################################################
               # Detect类不支持静态方法的前向传播,因此使用类直接调用方法
               output = self.detect.forward(face_loc.view(face_loc.size(0), -1, 4),
                                            self.softmax(face_conf.view(face_conf.size(0), -1, self.num_classes)),
                                            self.priors.type(type(x.data)))
               ###########################################################修改代码################################################################

Activity

  1. changed the title [-]Fix new-style autograd function with static forward method[/-] [+] Fix RuntimeError: Legacy autograd function with non-static forward method is deprecated[/+] on Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions