GithubHelp home page GithubHelp logo

Comments (6)

Luobupi avatar Luobupi commented on July 25, 2024 1

谢谢您的帮助,通过多次调试,发现是我的代码在加载模型参数时的异常导致的错误,已经解决了,不好意思,耽误您的时间了!
祝您科研顺利,工作愉快!

from libmtl.

Baijiong-Lin avatar Baijiong-Lin commented on July 25, 2024
  1. nn.CrossEntropyLoss()和nn.KLDivLoss()对target/gt的维度要求是不同的,比如model输出的prediction的维度是64x31,其中64是batch size的维度,那么nn.CrossEntropyLoss()的target的维度是64,而nn.KLDivLoss()的是64x31。具体可以参考pytorch官方文档中关于nn.CrossEntropyLoss()nn.KLDivLoss()的说明和例子。
  2. 从你提供的信息中,我没找到bug在哪==。

from libmtl.

Luobupi avatar Luobupi commented on July 25, 2024

我换过几个损失函数的计算方式,都显示在DWA loss.backward()的时候,说在进行反向传播时[512,31]这个向量里面有值发生了inplace操作,但是我并没有在损失函数中有类似+=或者类似的inplace操作

from libmtl.

Baijiong-Lin avatar Baijiong-Lin commented on July 25, 2024

“[512,31]这个向量”, 这个向量是哪个

from libmtl.

Luobupi avatar Luobupi commented on July 25, 2024

decoder定义为linear,在office-31数据集中,就是把512维的向量映射到31个类别中,所以相当于给encoder的输出结果乘以[512,31]的矩阵向量。
模型在反向传播时,对这个矩阵向量的权值进行更新

from libmtl.

Baijiong-Lin avatar Baijiong-Lin commented on July 25, 2024

单靠这样的描述很难找到bug,如果方便还是麻烦你提供一下可复现这个bug的代码吧

from libmtl.

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.