"...git@gitlab.liu.se:xuagu37/berzelius-benchmarks.git" did not exist on "d15947fadd64f117358cf65fed7f6fe8c76b3189"
Newer
Older
MODULE_NAME=nnunet_for_pytorch
MODULE_VERSION=21.11.0
WORK_DIR=/proj/nsc_testing/xuan/berzelius-benchmarks/PyTorch/Segmentation/nnUNet
CONTAINER_DIR=/proj/nsc_testing/xuan/containers/${MODULE_NAME}_${MODULE_VERSION}.sif
mkdir -p $WORK_DIR/data $WORK_DIR/results
To download and preprocess the data run:
apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python download.py --task 01
apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python /workspace/nnunet_pyt/preprocess.py --task 01 --dim 2
apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python scripts/benchmark.py --mode train --gpus 1 --dim 2 --batch_size 256 --amp
apptainer exec --nv -B ${WORK_DIR}/data:/data -B ${WORK_DIR}/results:/results --pwd /workspace/nnunet_pyt $CONTAINER_DIR python scripts/benchmark.py --mode predict --gpus 1 --dim 2 --batch_size 256 --amp
# Known issue https://github.com/NVIDIA/DeepLearningExamples/issues/1113
ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/opt/conda/lib/python3.8/site-packages/torchmetrics/utilities/data.py)
Solution 1: pip install pytorch-lightning==1.5.10, another error raised when benchmarking predict:
Traceback (most recent call last):
File "main.py", line 110, in <module>
trainer.current_epoch = 1
AttributeError: can't set attribute
Solution 2.1: pip install torchmetrics==0.6.0, another error raised:
File "main.py", line 34, in <module>
set_affinity(int(os.getenv("LOCAL_RANK", "0")), args.gpus, mode=args.affinity)
File "/workspace/nnunet_pyt/utils/gpu_affinity.py", line 376, in set_affinity
set_socket_unique_affinity(gpu_id, nproc_per_node, cores, "contiguous", balanced)
File "/workspace/nnunet_pyt/utils/gpu_affinity.py", line 263, in set_socket_unique_affinity
os.sched_setaffinity(0, ungrouped_affinities[gpu_id])
OSError: [Errno 22] Invalid argument
# Muiti-node is not supported in 21.11.0 yet but only in the most recent code on GitHub.