Code Monkey home page Code Monkey logo

Comments (8)

JiYuanFeng avatar JiYuanFeng commented on June 27, 2024

from mctrans.

imcjx avatar imcjx commented on June 27, 2024

我使用的配置文件是mctrans_vgg32_d5.py

model = dict(
    type='EncoderDecoder',
    pretrained=None,
    encoder=dict(
        type="VGG",
        in_channel=3,
        init_channels=32,
        num_blocks=2),
    center=dict(
        type="MCTrans",
        d_model=128,
        nhead=8,
        d_ffn=512,
        dropout=0.1,
        act="relu",
        n_levels=3,
        n_points=4,
        n_sa_layers=6),
    decoder=dict(
        type="UNetDecoder",
        in_channels=[32, 64, 128, 128, 128],
    ),
    seg_head=dict(
        type="BasicSegHead",
        in_channels=32,
        num_classes=19, # 6
        post_trans=[dict(type="Activations", softmax=True),
                    dict(type="AsDiscrete", argmax=True)],
        losses=[dict(type="DiceLoss", softmax=True, to_onehot_y=True),
                dict(type="CrossEntropyLoss"),
                dict(type="FLoss")]),
    aux_head=dict(
        type="MCTransAuxHead",
        d_model=128,
        d_ffn=512,
        act="relu",
        num_classes=19, # 6
        in_channles=[32, 64, 128, 128, 128],
        losses=[dict(type="MCTransAuxLoss", sigmoid=True, loss_weight=0.1)]),
)

from mctrans.

JiYuanFeng avatar JiYuanFeng commented on June 27, 2024

from mctrans.

imcjx avatar imcjx commented on June 27, 2024

我使用的monai版本就是0.5.3
image

from mctrans.

JiYuanFeng avatar JiYuanFeng commented on June 27, 2024

hi,你可以提供你的数据在进入mctrans之前的shape吗?可能的话,提供下一张data还有mask,我这边debug一下

from mctrans.

imcjx avatar imcjx commented on June 27, 2024

你好,非常感谢你热心的解答,这个问题已经解决了,是维度的问题。但我自己的数据集里的GT中的像素有的值为255,是不需要计算指标的像素,这使我在使用损失时会遇到问题,只有交叉熵的损失有ignore_index的参数来让我忽略这些不需要计算的参数,Dice_Loss、FLoss、MCTransAuxLoss并没有这个参数,请问有什么办法可以解决这个问题么。

from mctrans.

JiYuanFeng avatar JiYuanFeng commented on June 27, 2024

Hi, 你那边可以对这几个loss进行更改,在计算loss的时候增加一个mask。或者你也可以在数据集里面简单对label进行remap, 例如将255 转为0,虽然简单,但是这会参与计算。

if self.label_map is not None:

from mctrans.

imcjx avatar imcjx commented on June 27, 2024

非常感谢你的解答

from mctrans.

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.