nnunetv2实战步骤

希望找一些小伙伴,共同研究nnunetv2版代码,有意者请私聊。!!!!!!

以下实操步骤请在linux系统下操作,bilibili相关地址:【nnunetV2实操分享和代码精读倡议】https://www.bilibili.com/video/BV1Xw411z7E7?vd_source=a4bd8a5276d0156f1f19e2e9eb9d9519

1、下载源码:https://github.com/MIC-DKFZ/nnUNet和数据集


2、配置环境
注意:cuda版本:11.7  torch版本>=2.0


3、修改框架路径

D:\Codes\python\nnUNet-master\nnunetv2\path.py

base = r'D:\Codes\python\nnUNet-master\DATASET\nnUNet_raw'
preprocessing_output_dir = r'D:\Codes\python\nnUNet-master\DATASET\nnUNet_preprocessed'
network_training_output_dir_base = r'D:\Codes\python\nnUNet-master\DATASET\nnUNet_result'


3、制作数据集--将nnunetv1版本的dataset格式转换为nnunetv2版本所需要的格式

cd D:\Codes\python\nnUNet-master\nnunetv2\dataset_conversion

python convert_raw_dataset_from_old_nnunet_format.py 
D:\Codes\python\nnUNet-nnunetv1\DATASET\nnUNet_raw\nnUNet_raw_data\Task08_HepaticVessel 
Dataset008_HepaticVessel


4、检查数据集

cd D:\Codes\python\nnUNet-master\nnunetv2\experiment_planning\

修改代码:
import sys
sys.path.append(r'D:\Codes\python\nnUNet-master')

修改:example_folder = join(nnUNet_raw, 'Dataset008_HepaticVessel')

执行命令:python verify_dataset_integrity.py  

5、预处理

cd D:\Codes\python\nnUNet-master\nnunetv2\experiment_planning\

修改代码:
import sys
sys.path.append(r'D:\Codes\python\nnUNet-master')

修改:np = {default_np[c] if c in default_np.keys() else 4 for c in args.c}  ===> np = [default_np[c] if c in default_np.keys() else 4 for c in args.c]

执行命令:python plan_and_preprocess_entrypoints.py -d 8   ---> 生成相关文件

6、训练网络

cd D:\Codes\python\nnUNet-master\nnunetv2\run\
修改代码:
import sys
sys.path.append(r'D:\Codes\python\nnUNet-master')

执行命令:python run_training.py Dataset008_HepaticVessel 3d_lowres 4    ---> 生成相关文件


7、预测

cd D:\Codes\python\nnUNet-master\nnunetv2\inference\
修改代码:
import sys
sys.path.append(r'D:\Codes\python\nnUNet-master')

修改:Dataset003_Liver
    use_folds=(0, ),  ----> use_folds=(4, ),

执行命令:python predict_from_raw_data.py   ---> 生成相关文件


 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值