GithubHelp home page GithubHelp logo

RuntimeError: einsum(): the number of subscripts in the equation (3) does not match the number of dimensions (4) for operand 0 and no ellipsis was given about deq HOT 1 CLOSED

locuslab avatar locuslab commented on July 21, 2024
RuntimeError: einsum(): the number of subscripts in the equation (3) does not match the number of dimensions (4) for operand 0 and no ellipsis was given

from deq.

Comments (1)

jerrybai1995 avatar jerrybai1995 commented on July 21, 2024 1

Hi @QiyaoWei ,

Thanks for your interest in our work. It seems like you are using a 4D tensor rather than a 3D tensor. You should do the following instead:

bsz, C = 128, 3
H, W = 32, 32
test = torch.rand(128, 3, 32, 32).to(device)
layer = ResNetLayer().to(device)
f = lambda x: layer(x.view(bsz, C, H, W)).view(bsz, C, -1)
zz = broyden(f, torch.zeros_like(test).view(bsz, C, -1), threshold=100, eps=1e-1)['result']

As a side note, I suggest adding some normalization layers to your ResNetLayer design. Without normalizations it is likely that this layer will not converge with random initialization.

from deq.

Related Issues (20)

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.