GenSeg-Baselines / code /scripts /pannuke_cv_nnunet.sh
MaybeRichard's picture
Upload folder using huggingface_hub
057ec4b verified
Raw
History Blame Contribute Delete
1.89 kB
#!/bin/bash
# nnU-Net PanNuke fold02(d11)+fold03(d12): train fold0 on both A100s, predict, score.
set -u
cd /home/wzhang/LSC/Code/NPJ
source /opt/anaconda3/etc/profile.d/conda.sh
RAW=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/raw
PRED=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/predTs
DATA_ROOT=/home/wzhang/LSC/Dataset/Segmentation/processed_unified
export CUDA_DEVICE_ORDER=PCI_BUS_ID
conda activate nnunet
export nnUNet_raw=$RAW
export nnUNet_preprocessed=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/preprocessed_nnunet
export nnUNet_results=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/results_nnunet
export nnUNet_n_proc_DA=8 OMP_NUM_THREADS=4
CUDA_VISIBLE_DEVICES=4 nnUNetv2_train 11 2d 0 -tr nnUNetTrainer_250epochs > nnunet_workspace/train_nnunet_d11.log 2>&1 &
CUDA_VISIBLE_DEVICES=5 nnUNetv2_train 12 2d 0 -tr nnUNetTrainer_250epochs > nnunet_workspace/train_nnunet_d12.log 2>&1 &
wait
echo NNUNET_CV_TRAIN_DONE
CUDA_VISIBLE_DEVICES=4 nnUNetv2_predict -i "$RAW/Dataset011_pannuke_semantic_fold02/imagesTs" -o "$PRED/d11_f0" -d 11 -c 2d -f 0 -tr nnUNetTrainer_250epochs --disable_tta > nnunet_workspace/pred_nnunet_d11.log 2>&1 &
CUDA_VISIBLE_DEVICES=5 nnUNetv2_predict -i "$RAW/Dataset012_pannuke_semantic_fold03/imagesTs" -o "$PRED/d12_f0" -d 12 -c 2d -f 0 -tr nnUNetTrainer_250epochs --disable_tta > nnunet_workspace/pred_nnunet_d12.log 2>&1 &
wait
conda deactivate; conda activate seggen
export OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 OPENBLAS_NUM_THREADS=8
python framework/nnunet_eval.py --data_root "$DATA_ROOT" --dataset pannuke_semantic --protocol fold02 --raw "$RAW" --dataset_id 11 --fold 0 --pred_dir "$PRED/d11_f0" --arch nnunet --exp_name baselines
python framework/nnunet_eval.py --data_root "$DATA_ROOT" --dataset pannuke_semantic --protocol fold03 --raw "$RAW" --dataset_id 12 --fold 0 --pred_dir "$PRED/d12_f0" --arch nnunet --exp_name baselines
echo NNUNET_CV_DONE