Giter Club home page Giter Club logo

Comments (2)

liu-zhy avatar liu-zhy commented on August 22, 2024

Thanks for your attention. The code and pretrained models are only tested on PyTorch1.1. Thus it may encounter some errors when running with pytorch of higher version due to the incompatibility. As your problem, I advise you to use MMAction2 ^_^.

from temporal-adaptive-module.

wlin-at avatar wlin-at commented on August 22, 2024

Hi I think here the error is that for higher pytorch version, you need to decorate the forward and backward function of the torch.autograd.Function as @staticmethod.
But my question, why do we need a torch.autograd.Function as the SegmentConsensus function here? can't we just simply implment this as a normal torch.nn.Module as in the following?

class ConsensusModule(torch.nn.Module):  # contains no parameters 

    def __init__(self, consensus_type, dim=1):
        super(ConsensusModule, self).__init__()
        self.consensus_type = consensus_type if consensus_type != 'rnn' else 'identity'
        self.dim = dim
        # assert self.dim == 1
    def forward(self, input): #  input_tensor (bz, T, n_class)
        if self.consensus_type == 'avg':
            return input.mean(dim=self.dim, keepdim=True)
        elif self.consensus_type == 'identity':
            return input

from temporal-adaptive-module.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.