BraTS2025(SiNGR)

环境配置

#requirement.yaml
name: singr
channels:
  - defaults
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2023.12.12=h06a4308_0
  - ld_impl_linux-64=2.38=h1181459_1
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=23.3.1=py38h06a4308_0
  - python=3.8.5=h7579374_1
  - readline=8.2=h5eee18b_0
  - setuptools=68.2.2=py38h06a4308_0
  - sqlite=3.41.2=h5eee18b_0
  - tk=8.6.12=h1ccaba5_0
  - wheel=0.41.2=py38h06a4308_0
  - xz=5.4.6=h5eee18b_0
  - zlib=1.2.13=h5eee18b_0
  - pip:
    - absl-py==2.1.0
    - cachetools==5.3.3
    - certifi==2024.2.2
    - charset-normalizer==3.3.2
    - click==8.1.7
    - contextlib2==21.6.0
    - contourpy==1.1.1
    - cycler==0.12.1
    - efficientnet-pytorch==0.7.1
    - einops==0.7.0
    - filelock==3.13.1
    - fire==0.5.0
    - fonttools==4.49.0
    - fsspec==2024.2.0
    - google-auth==2.28.1
    - google-auth-oauthlib==1.0.0
    - grpcio==1.62.0
    - huggingface-hub==0.21.4
    - idna==3.6
    - imageio==2.34.0
    - importlib-metadata==7.0.1
    - importlib-resources==6.1.2
    - imutils==0.5.4
    - joblib==1.3.2
    - kiwisolver==1.4.5
    - lazy-loader==0.3
    - markdown==3.5.2
    - markupsafe==2.1.5
    - matplotlib==3.7.5
    - medmnist==3.0.1
    - ml-collections==0.1.1
    - monai==1.0.1
    - munch==4.0.0
    - natsort==8.4.0
    - networkx==3.1
    - nibabel==5.2.1
    - numpy==1.24.4
    - oauthlib==3.2.2
    - omegaconf
    - opencv-python-headless==4.5.1.48
    - packaging==23.2
    - pandas==1.3.5
    - pillow==10.2.0
    - pretrainedmodels==0.7.4
    - protobuf==4.25.3
    - pyasn1==0.5.1
    - pyasn1-modules==0.3.0
    - pyparsing==3.1.2
    - python-dateutil==2.9.0.post0
    - pytz==2024.1
    - pywavelets==1.4.1
    - pyyaml==6.0.1
    - requests==2.31.0
    - requests-oauthlib==1.3.1
    - rsa==4.9
    - safetensors==0.4.2
    - scikit-image==0.18.1
    - scikit-learn==1.3.2
    - scipy==1.10.1
    - segmentation-models-pytorch==0.3.3
    - simpleitk==2.3.1
    - six==1.16.0
    - solt
    - tensorboard==2.14.0
    - tensorboard-data-server==0.7.2
    - termcolor==2.4.0
    - threadpoolctl==3.3.0
    - tifffile==2023.7.10
    - timm==0.9.2
    - torch==1.8.1
    - torchvision==0.9.1
    - tqdm==4.66.2
    - typing-extensions==4.10.0
    - tzdata==2024.1
    - urllib3==2.2.1
    - werkzeug==3.0.1
    - yacs==0.1.8
    - zipp==3.17.0
prefix: /home/user/miniconda3/envs/singr

注意 omegeaconf 和 solt 需要去掉版本号, 否则会有不兼容的问题

预处理

#先cd到untils,split产生的pkl和csv都默认在utils文件夹读取
#python split_brats.py --root /data/coding/BraTS2025 --output_dir ./
#注意先写脚本把brats25改成和20命名和目录完全一致的格式,否则整个项目都跑不通
#注意生成种子默认12345
#检查csv是否有问题,没有的话pkl就也正常

训练

#先cd到根目录singr-main
python -m mlpipeline.train.run experiment=brats_sem_seg

训练过程中非常容易爆内存, 性能瓶颈在 cpu. 尽可能使用分布式训练