Giter Club home page Giter Club logo

Comments (5)

yearing1017 avatar yearing1017 commented on July 26, 2024

@Serge-weihao

from ccnet-pure-pytorch.

Serge-weihao avatar Serge-weihao commented on July 26, 2024

x和x_dsn被分别求loss,然后对各自的loss加权求和得到最后的loss,所以不应该cat

from ccnet-pure-pytorch.

yearing1017 avatar yearing1017 commented on July 26, 2024

感谢回复,如果我只想在我的程序中使用CCNet网络,例如输入:[4,3,320,320],然后输出为[4,4,320,320],分割为4类,是不是应该修改网络forward代码:最后使用上采样得到输出? @Serge-weihao

from ccnet-pure-pytorch.

yearing1017 avatar yearing1017 commented on July 26, 2024

您好,我这样修改ccnet.py的forward代码,不分别求loss,对x_dsn和x进行融合,然后进行分割,只对这一个结果与label求loss,可以吗?

    def forward(self, x, labels=None):
        #print(111)
        size = (x.shape[2], x.shape[3])
        x = self.relu1(self.bn1(self.conv1(x)))
        x = self.relu2(self.bn2(self.conv2(x)))
        x = self.relu3(self.bn3(self.conv3(x)))
        x = self.maxpool(x)
        x = self.layer1(x)
        x = self.layer2(x)
        #print(222)
        x = self.layer3(x)
        #print(333)
        x_dsn = self.dsn(x)
        #print(x_dsn.shape)
        x = self.layer4(x)
        #print(x.shape)
        x = self.head(x, self.recurrence)
        #print(x.shape)
        outs = torch.cat([x, x_dsn],1)
        print(outs.shape)
        outs = self.conv4(outs)
        outs = nn.Upsample(size, mode='bilinear', align_corners=True)(outs)
        #print(outs)
        return outs

from ccnet-pure-pytorch.

Serge-weihao avatar Serge-weihao commented on July 26, 2024

deeplabv3plus就是类似的结构,不同level concat起来,你觉得合适就行

from ccnet-pure-pytorch.

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.