Git Product home page Git Product logo

Comments (5)

ZouJiu1 avatar ZouJiu1 commented on July 4, 2024

index 2 is "[return grad_weight, grad_alpha, None, None, None, grad_beta] " None, it correspond to the "[weight, alpha, g, Qn, Qp, beta]" g, g have no gradient and it gradient should be None.

from lsqplus.

ZouJiu1 avatar ZouJiu1 commented on July 4, 2024

It is the answer about backward. RuntimeError: function ALSQPlusBackward returned a gradient different than None at position

from lsqplus.

lulululichuan avatar lulululichuan commented on July 4, 2024

index 2 is "[return grad_weight, grad_alpha, None, None, None, grad_beta] " None, it correspond to the "[weight, alpha, g, Qn, Qp, beta]" g, g have no gradient and it gradient should be None.

Yes, I used the code from your repo , and it shows that the func of ALSQPlus have the "return grad_weight, grad_alpha, None, None, None, grad_beta" originally.

from lsqplus.

wenpingd avatar wenpingd commented on July 4, 2024

Hi author, thank you for your great work! I meet a problem when using Lsq+_V2: Traceback (most recent call last): File "train.py", line 273, in <module> train(args) File "train.py", line 201, in train scaler.scale(loss).backward() File "/home/work/ssd1/anaconda3/envs/py38/lib/python3.8/site-packages/torch/_tensor.py", line 396, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs) File "/home/work/ssd1/anaconda3/envs/py38/lib/python3.8/site-packages/torch/autograd/__init__.py", line 173, in backward Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: Function ALSQPlusBackward returned an invalid gradient at index 2 - got [1] but expected shape compatible with [0] It seems that the backward func of ALSQPlus has some errors, any advice of how to solve this problem? Thanks in advance!

Hi lulululichuan, have you solved this problem?

from lsqplus.

MJITG avatar MJITG commented on July 4, 2024

多卡会有这个问题,单卡不会
It occurs when training with multi GPUs and is OK with single GPU

from lsqplus.

Related Issues (16)

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.