GithubHelp home page GithubHelp logo

mic-dkfz / mednext Goto Github PK

View Code? Open in Web Editor NEW
259.0 9.0 20.0 561 KB

MedNeXt is a fully ConvNeXt architecture for 3D medical image segmentation (MICCAI 2023).

License: Apache License 2.0

Python 100.00%
convnext medical-image-analysis medical-image-segmentation medical-imaging transformers unet-image-segmentation mednext

mednext's Introduction

MedNeXt

Copyright © German Cancer Research Center (DKFZ), Division of Medical Image Computing (MIC). Please make sure that your usage of this code is in compliance with the code license.

MedNeXt is a fully ConvNeXt architecture for 3D medical image segmentation designed to leverage the scalability of the ConvNeXt block while being customized to the challenges of sparsely annotated medical image segmentation datasets. MedNeXt is a model under development and is expected to be updated periodically in the near future.

The current training framework is built on top of nnUNet (v1) - the module name nnunet_mednext reflects this. You are free to adopt the architecture for your own training pipeline or use the one in this repository. Instructions are provided for both paths.

[arXiv, 2023] [MICCAI 2023]

Please cite the following work if you find this model useful for your research:

Roy, S., Koehler, G., Ulrich, C., Baumgartner, M., Petersen, J., Isensee, F., Jaeger, P.F. & Maier-Hein, K. (2023).
MedNeXt: Transformer-driven Scaling of ConvNets for Medical Image Segmentation. 
International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2023.

Please also cite the following work if you use this pipeline for training:

Isensee, F., Jaeger, P. F., Kohl, S. A., Petersen, J., & Maier-Hein, K. H. (2020). 
nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods, 1-9.

Table of Contents

Current Versions and notable features:

  • v1 (MICCAI 2023): Fully 3D ConvNeXt architecture, residual ConvNeXt resampling, UpKern for large kernels, gradient checkpointing for training large models

As mentioned earlier, MedNeXt is actively under development and further improvements to the pipeline as future versions are anticipated.

Installation

The repository can be cloned and installed using the following commands.

git clone https://github.com/MIC-DKFZ/MedNeXt.git mednext
cd mednext
pip install -e .

MedNeXt Architecture and Usage in external pipelines

MedNeXt is usable on external training pipeline for 3D volumetric segmentation, similar to any PyTorch nn.Module. It is functionally decoupled from nnUNet when used simply as an architecture. It is sufficient to install the repository and import either the architecture or the block. In theory, it is possible to freely customize the network using MedNeXt both as an encoder-decoder style network as well as a block.

MedNeXt v1

MedNeXt v1 is the first version of the MedNeXt and incorporates the architectural features described here.

Important: MedNeXt v1 was trained with 1.0mm isotropic spacing as favored by architectures like UNETR, SwinUNETR and the usage of alternate spacing, like median spacing favored by native nnUNet, while perfectly usable in theory, is currently untested with MedNeXt v1 and may affect performance.

The usage as whole MedNeXt v1 as a complete architecture as well as the use of MedNeXt blocks (in external architectures, for example) is described below.

Usage as whole MedNeXt v1 architecture:

The architecture can be imported as follows with a number of arguments.

from nnunet_mednext.mednextv1 import MedNeXt

model = MedNeXt(
          in_channels: int,                         # input channels
          n_channels: int,                          # number of base channels
          n_classes: int,                           # number of classes
          exp_r: int = 4,                           # Expansion ratio in Expansion Layer
          kernel_size: int = 7,                     # Kernel Size in Depthwise Conv. Layer
          enc_kernel_size: int = None,              # (Separate) Kernel Size in Encoder
          dec_kernel_size: int = None,              # (Separate) Kernel Size in Decoder
          deep_supervision: bool = False,           # Enable Deep Supervision
          do_res: bool = False,                     # Residual connection in MedNeXt block
          do_res_up_down: bool = False,             # Residual conn. in Resampling blocks
          checkpoint_style: bool = None,            # Enable Gradient Checkpointing
          block_counts: list = [2,2,2,2,2,2,2,2,2], # Depth-first no. of blocks per layer 
          norm_type = 'group',                      # Type of Norm: 'group' or 'layer'
          dim = '3d'                                # Supports `3d', '2d' arguments
)

Please note that - 1) Deep Supervision, and 2) residual connections in both MedNeXt and Up/Downsampling blocks are both used in the publication for training.

Gradient Checkpointing can be used to train larger models in low memory devices by trading compute for activation storage. The checkpointing implemented in this version is at the MedNeXt block level.

MedNeXt v1 has been tested with 4 defined architecture sizes and 2 defined kernel sizes. Their particulars are as follows:

Name (Model ID) Kernel Size Parameters GFlops
Small (S) 3x3x3 5.6M 130
Small (S) 5x5x5 5.9M 169
Base (B) 3x3x3 10.5M 170
Base (B) 5x5x5 11.0M 208
Medium (M) 3x3x3 17.6M 248
Medium (M) 5x5x5 18.3M 308
Large (L) 3x3x3 61.8M 500
Large (L) 5x5x5 63.0M 564

Utility functions have been defined for re-creating these architectures (with or without deep supervision) as follows customized to input channels, number of target classes, model IDs as used in the publication, kernel size and deep supervision:

from nnunet_mednext import create_mednext_v1

model = create_mednext_v1(
  num_channels = 3,
  num_classes = 10,
  model_id = 'B',             # S, B, M and L are valid model ids
  kernel_size = 3,            # 3x3x3 and 5x5x5 were tested in publication
  deep_supervision = True     # was used in publication
)

Individual Usage of MedNeXt blocks

MedNeXt blocks can be imported for use individually similar to the entire architecture. The following blocks can be imported directed for use.

from nnunet_mednext import MedNeXtBlock, MedNeXtDownBlock, MedNeXtUpBlock

# Standard MedNeXt block
block = MedNeXtBlock(
    in_channels:int,              # no. of input channels
    out_channels:int,             # no. of output channels
    exp_r:int=4,                  # channel expansion ratio in Expansion Layer
    kernel_size:int=7,            # kernel size in Depthwise Conv. Layer
    do_res:bool=True,              # residual connection on or off. Default: True
    norm_type:str = 'group',      # type of norm: 'group' or 'layer'
    n_groups:int or None = None,  # no. of groups in Depthwise Conv. Layer
                                  # (keep 'None' in most cases)
)


# 2x Downsampling with MedNeXt block
block_down = MedNeXtDownBlock(
    in_channels:int,              # no. of input channels
    out_channels:int,             # no. of output channels
    exp_r:int=4,                  # channel expansion ratio in Expansion Layer
    kernel_size:int=7,            # kernel size in Depthwise Conv. Layer
    do_res:bool=True,              # residual connection on or off. Default: True
    norm_type:str = 'group',      # type of norm: 'group' or 'layer'
)


# 2x Upsampling with MedNeXt block
block_up = MedNeXtUpBlock(
    in_channels:int,              # no. of input channels
    out_channels:int,             # no. of output channels
    exp_r:int=4,                  # channel expansion ratio in Expansion Layer
    kernel_size:int=7,            # kernel size in Depthwise Conv. Layer
    do_res:bool=True,              # residual connection on or off. Default: True
    norm_type:str = 'group',      # type of norm: 'group' or 'layer'
)

UpKern weight loading

UpKern is a simple algorithm for initializing a large kernel MedNeXt network with an equivalent small kernel MedNeXt. Equivalent refers to a network of the same configuration with the only difference being kernel size in the Depthwise Convolution layers. Large kernels are initialized by trilinear interpolation of their smaller counterparts. The following is an example of using this weight loading style.

from nnunet_mednext import create_mednext_v1
from nnunet_mednext.run.load_weights import upkern_load_weights
m_net_ = create_mednext_v1(1, 3, 'S', 5)
m_pre = create_mednext_v1(1, 3, 'S', 3)

# Generally m_pre would be pretrained
m3 = upkern_load_weights(m_net_, m_pre)

Usage of internal training pipeline

Plan and Preprocess

To preprocess your datasets as in the MICCAI 2023 version, please run

mednextv1_plan_and_preprocess -t YOUR_TASK -pl3d ExperimentPlanner3D_v21_customTargetSpacing_1x1x1 -pl2d ExperimentPlanner2D_v21_customTargetSpacing_1x1x1

As in nnUNet, you can set -pl3d or -pl2d as None if you do not require preprocessed data in those dimensions. Please note that YOUR_TASK in this repo is designed to be in the old nnUNet(v1) format. If you want to use the latest nnUNet (v2), you will have to adopt the preprocessor on your own.

The custom ExperimentPlanner3D_v21_customTargetSpacing_1x1x1 is designed to set patch size to 128x128x128 and spacing to 1mm isotropic since those are the experimental conditions used in the MICCAI 2023 version.

Train MedNeXt using nnUNet (v1) training

MedNeXt has custom nnUNet (v1) trainers that allow it to be trained similar to the base architecture. Please check the old nnUNet(v1) branch in the nnUNet repo, if you are unfamiliar with this code format. Please look here for all available trainers to recreate the MICCAI 2023 experiments. Please note that all trainers are in 3D since the architecture was tested in 3D. You can of course, create your custom trainers if you want (including 2D trainers for 2D architectures).

mednextv1_train 3d_fullres TRAINER TASK_NUMBER FOLD -p nnUNetPlansv2.1_trgSp_1x1x1

There are trainers for 4 architectures (S, B, M, L) and 2 kernel sizes (3, 5) to replicate the experiments from MICCAI 2023. The following is an example for training an nnUNetTrainerV2_MedNeXt_S_kernel3 trainer on the task Task040_KiTS2019 on fold 0 of the 5-folds split generated by nnUNet's data preprocessor.

mednextv1_train 3d_fullres nnUNetTrainerV2_MedNeXt_S_kernel3 Task040_KiTS2019 0 -p nnUNetPlansv2.1_trgSp_1x1x1

A kernel 5x5x5 version from scratch can also be trained this way, although we recommend initially training a kernel 3x3x3 version and using UpKern.

Train a kernel 5x5x5 version using UpKern

To train a kernel 5x5x5 version using UpKern, a kernel 3x3x3 version must already be trained. To train using UpKern, simply run the following:

mednextv1_train 3d_fullres TRAINER TASK FOLD -p nnUNetPlansv2.1_trgSp_1x1x1 -pretrained_weights YOUR_MODEL_CHECKPOINT_FOR_KERNEL_3_FOR_SAME_TASK_AND_FOLD -resample_weights

The following is an example for training an nnUNetTrainerV2_MedNeXt_S_kernel5 trainer on the task Task040_KiTS2019 on fold 0 of the 5-folds split generated by nnUNet's data preprocessor by using UpKern.

mednextv1_train 3d_fullres nnUNetTrainerV2_MedNeXt_S_kernel5 Task040_KiTS2019 0 -p nnUNetPlansv2.1_trgSp_1x1x1 -pretrained_weights SOME_PATH/nnUNet/3d_fullres/Task040_KiTS2019/nnUNetTrainerV2_MedNeXt_S_kernel3__nnUNetPlansv2.1_trgSp_1x1x1/fold_0/model_final_checkpoint.model -resample_weights

The -resample_weights flag as it is responsible to triggering the UpKern algorithm.

A note on 2D MedNeXt:

Please note that while the MedNeXt can run on 2D, it has not been tested in 2D mode.

mednext's People

Contributors

saikat-roy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mednext's Issues

several import errors

Hi,
Thanks for your great job about the MedNeXt. I found several import errors while running the code, the followings are my advice for the bug fix,please consider it carefully!
image
image
image
image

Excessive GPU memory consumption

Hi, recently, I used the MedNext model (5.6M, Small (S)) to segment volumes with the image size of (80,160,160), but it requires 20G GPU memory, and nnUNet only needs 10G. Is it normal? can you help me to resolve the problem of excessive GPU memory consumption?

nnUNet_plan_and_preprocess: command not found

(MedNeXt) zw@T640:~/myData/Code/study/MedNeXt$ pip install -U .
Processing /home/zw/myData/Code/study/MedNeXt
  Preparing metadata (setup.py) ... done
Requirement already satisfied: torch>1.10.0 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (1.12.1+cu113)
Requirement already satisfied: tqdm in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (4.65.0)
Requirement already satisfied: dicom2nifti in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (2.4.8)
Requirement already satisfied: scikit-image>=0.14 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (0.21.0)
Requirement already satisfied: medpy in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (0.4.0)
Requirement already satisfied: scipy in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (1.11.1)
Requirement already satisfied: batchgenerators>=0.23 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (0.25)
Requirement already satisfied: numpy in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (1.25.1)
Requirement already satisfied: sklearn in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (0.0.post5)
Requirement already satisfied: SimpleITK in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (2.2.1)
Requirement already satisfied: pandas in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (2.0.3)
Requirement already satisfied: requests in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (2.31.0)
Requirement already satisfied: nibabel in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (5.1.0)
Requirement already satisfied: tifffile in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (2023.7.10)
Requirement already satisfied: matplotlib in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from mednextv1==1.7.0) (3.7.2)
Requirement already satisfied: unittest2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from batchgenerators>=0.23->mednextv1==1.7.0) (1.1.0)
Requirement already satisfied: pillow>=7.1.2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from batchgenerators>=0.23->mednextv1==1.7.0) (10.0.0)
Requirement already satisfied: threadpoolctl in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from batchgenerators>=0.23->mednextv1==1.7.0) (3.2.0)
Requirement already satisfied: scikit-learn in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from batchgenerators>=0.23->mednextv1==1.7.0) (1.3.0)
Requirement already satisfied: future in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from batchgenerators>=0.23->mednextv1==1.7.0) (0.18.3)
Requirement already satisfied: packaging>=21 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-image>=0.14->mednextv1==1.7.0) (23.1)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-image>=0.14->mednextv1==1.7.0) (1.4.1)
Requirement already satisfied: imageio>=2.27 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-image>=0.14->mednextv1==1.7.0) (2.31.1)
Requirement already satisfied: lazy_loader>=0.2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-image>=0.14->mednextv1==1.7.0) (0.3)
Requirement already satisfied: networkx>=2.8 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-image>=0.14->mednextv1==1.7.0) (3.1)
Requirement already satisfied: typing-extensions in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from torch>1.10.0->mednextv1==1.7.0) (4.7.1)
Requirement already satisfied: pydicom>=2.2.0 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from dicom2nifti->mednextv1==1.7.0) (2.4.1)
Requirement already satisfied: python-gdcm in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from dicom2nifti->mednextv1==1.7.0) (3.0.22)
Requirement already satisfied: python-dateutil>=2.7 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (2.8.2)
Requirement already satisfied: importlib-resources>=3.2.0 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (6.0.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (4.41.0)
Requirement already satisfied: cycler>=0.10 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (0.11.0)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (3.0.9)
Requirement already satisfied: contourpy>=1.0.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (1.1.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from matplotlib->mednextv1==1.7.0) (1.4.4)
Requirement already satisfied: tzdata>=2022.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from pandas->mednextv1==1.7.0) (2023.3)
Requirement already satisfied: pytz>=2020.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from pandas->mednextv1==1.7.0) (2023.3)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from requests->mednextv1==1.7.0) (2.0.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from requests->mednextv1==1.7.0) (3.2.0)
Requirement already satisfied: idna<4,>=2.5 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from requests->mednextv1==1.7.0) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from requests->mednextv1==1.7.0) (2023.5.7)
Requirement already satisfied: zipp>=3.1.0 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib->mednextv1==1.7.0) (3.16.2)
Requirement already satisfied: six>=1.5 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->mednextv1==1.7.0) (1.16.0)
Requirement already satisfied: joblib>=1.1.1 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from scikit-learn->batchgenerators>=0.23->mednextv1==1.7.0) (1.3.1)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: traceback2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from unittest2->batchgenerators>=0.23->mednextv1==1.7.0) (1.4.0)
Requirement already satisfied: linecache2 in /home/zw/anaconda3/envs/MedNeXt/lib/python3.9/site-packages (from traceback2->unittest2->batchgenerators>=0.23->mednextv1==1.7.0) (1.0.0)
Building wheels for collected packages: mednextv1
  Building wheel for mednextv1 (setup.py) ... done
  Created wheel for mednextv1: filename=mednextv1-1.7.0-py3-none-any.whl size=6208 sha256=c9ccdbaa5ac24225ac78b695ff226ff4d1ca691544b000b4c5432e27ca94cd38
  Stored in directory: /tmp/pip-ephem-wheel-cache-s6lt09cy/wheels/af/0b/8e/386d902d82d2285808083f810f5d24690a7e29e5b76861f907
Successfully built mednextv1
Installing collected packages: argparse, mednextv1
Successfully installed argparse-1.4.0 mednextv1-1.7.0
(MedNeXt) zw@T640:~/myData/Code/study/MedNeXt$ nnUNet_plan_and_preprocess -t 1
nnUNet_plan_and_preprocess: command not found

python version: 3.9.13
pytorch version: 1.12.1+cu113

Valid accuracy

Hello, sorry to bother you.

I have encountered a strange issue, the validation accuracy decreased heavily (89.9% -> 50%) in the middle of training, then it continued to increase slowly, is it reasonable?

Thanks a lot.

Problem of training.

Excuse me. When training the model, it was always suggested that the model “mednext ” was undefined, and I don't know how to modify it. What specific modification is needed? Did some of the names change?

replace nnunetv2's with MedNeXt v1 have some problems

Hi, I replaced the model in nnunetv2 with MedNeXt v1 and trained the conveyor farmer i function as a nan value, and I see that the original nnunetv2 raw output is 3
convolution, and after adding a 3d convolution to the deep supervised output of MedNeXt v1, the situation is not improved!

Sharing the precise setup for your experiments

Hello @saikat-roy, thank you for open sourcing this work!

I am currently trying to reproduce it on my side, however, using the same conditions as in your supplementary material (i.e.: batch size= 2, patch 128x128x128 and 250 it/epochs wit the Small (S) model and k5 kernel, i get a 200 sec/ epoch runtime, different from your 117 secs.

I have eliminated the other options, so I am now left with setup differences.
Could you give us the setup you used ( GPU, pytorch version..) to train your model ?

Regards

Zach

Unable to reproduce the results for the AMOS and BraTS datasets

Hello,

I'm currently examining the possibility of reproducing your results. Would you be able to share the updated or most recent dataset conversion files for AMOS and BraTS datasets for your model at your earliest convenience?

Your assistance in this matter would be greatly appreciated. Thank you in advance.

I encountered a problem in the preprocessing stage, how should I solve it?

(MeNeXt) PS E:\PythonProject\MedNeXt> mednextv1_plan_and_preprocess -t 521 -pl3d ExperimentPlanner3D_v21_customTargetSpacing_1x1x1
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_007
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_001
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_002
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_006
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_005
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_004
E:\PythonProject\MedNeXt\mednext\DATASET\nnUNet_raw_data_base\nnUNet_raw_data\Task521_Lung\imagesTr\CTA_003

Task521_Lung
number of threads: (8, 8)

D:\Anaconda3\envs\MeNeXT\lib\site-packages\numpy\core\fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
D:\Anaconda3\envs\MeNeXT\lib\site-packages\numpy\core_methods.py:129: RuntimeWarning: invalid value encountered in scalar divide
ret = ret.dtype.type(ret / rcount)
not using nonzero mask for normalization
Are we using the nonzero mask for normalization? OrderedDict([(0, False)])
Traceback (most recent call last):
File "\?\D:\Anaconda3\envs\MeNeXt\Scripts\mednextv1_plan_and_preprocess-script.py", line 33, in
sys.exit(load_entry_point('mednextv1', 'console_scripts', 'mednextv1_plan_and_preprocess')())
File "e:\pythonproject\mednext\mednext\nnunet_mednext\experiment_planning\nnUNet_plan_and_preprocess.py", line 159, in main
exp_planner.plan_experiment()
File "e:\pythonproject\mednext\mednext\nnunet_mednext\experiment_planning\experiment_planner_baseline_3DUNet.py", line 266, in plan_experiment
median_shape = np.median(np.vstack(new_shapes), 0)
File "D:\Anaconda3\envs\MeNeXT\lib\site-packages\numpy\core\shape_base.py", line 289, in vstack
return _nx.concatenate(arrs, 0, dtype=dtype, casting=casting)
ValueError: need at least one array to concatenate

How to train MedNeXt

Dear author,
Thank you for your good job,I want to ask you about the training process, and how to train MedNeXt,

about batch_size

hi , i want to set the batch_size to 2, as it is out of memory, do you know where to set?

image

Deep supervision

Hi.

The paper is a great read. I have a question regarding deep supervision, which is not explained in the paper, but you have that in the main figure. Did you use deep supervision for all the other models that are used for comparison? If not, how can we make sure that the performance improvement is not caused by deep supervision (which theoretically is the case)?

Thank you for the response.

Regards,
Ikboljon Sobirov

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.