From cbc1fd73fe70cc0902b73b012546dfc730c7a555 Mon Sep 17 00:00:00 2001
From: Xuan Gu <xuan.gu@liu.se>
Date: Thu, 28 Sep 2023 11:48:32 +0000
Subject: [PATCH] Update 3 files

- /PyTorch/Segmentation/nnUNet/build.txt
- /PyTorch/Segmentation/nnUNet/benchmark.txt
- /PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def
---
 PyTorch/Segmentation/nnUNet/benchmark.txt                  | 1 +
 PyTorch/Segmentation/nnUNet/build.txt                      | 5 +++--
 PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/PyTorch/Segmentation/nnUNet/benchmark.txt b/PyTorch/Segmentation/nnUNet/benchmark.txt
index 7ee89df..5aa121a 100644
--- a/PyTorch/Segmentation/nnUNet/benchmark.txt
+++ b/PyTorch/Segmentation/nnUNet/benchmark.txt
@@ -25,4 +25,5 @@ apptainer exec --nv --pwd /workspace/nnunet_pyt $CONTAINER_DIR python scripts/be
 
 
 # Known issue 
+# ImportError: cannot import name 'get_num_classes' from 'torchmetrics.utilities.data' (/opt/conda/lib/python3.8/site-packages/torchmetrics/utilities/data.py)
 https://github.com/NVIDIA/DeepLearningExamples/issues/1113
diff --git a/PyTorch/Segmentation/nnUNet/build.txt b/PyTorch/Segmentation/nnUNet/build.txt
index 258b491..1a679da 100644
--- a/PyTorch/Segmentation/nnUNet/build.txt
+++ b/PyTorch/Segmentation/nnUNet/build.txt
@@ -3,12 +3,13 @@ https://catalog.ngc.nvidia.com/orgs/nvidia/resources/nnunet_for_pytorch/quick-st
 apptainer build containers/nvidia_pytorch_21.11-py3.sif  docker://nvcr.io/nvidia/pytorch:21.11-py3
 
 export APPTAINER_BINDPATH=
-gotesting
 
 MODULE_NAME=nnunet_for_pytorch
 MODULE_VERSION=21.11.0
+CONTAINER_DIR=/proj/nsc_testing/xuan/containers/${MODULE_NAME}_${MODULE_VERSION}.sif
+DEF_DIR=/proj/nsc_testing/xuan/berzelius-benchmarks/PyTorch/Segmentation/nnUNet/${MODULE_NAME}_${MODULE_VERSION}.def
 
-apptainer build ./containers/${MODULE_NAME}_${MODULE_VERSION}.sif ./berzelius-benchmarks/PyTorch/Segmentation/nnUNet/${MODULE_NAME}_${MODULE_VERSION}.def
+apptainer build $CONTAINER_DIR $DEF_DIR
 
 
 # Known issue 
diff --git a/PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def b/PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def
index 31fa8fe..abaedb4 100644
--- a/PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def
+++ b/PyTorch/Segmentation/nnUNet/nnunet_for_pytorch_21.11.0.def
@@ -16,7 +16,7 @@ cd /workspace/nnunet_pyt
 wget --content-disposition https://api.ngc.nvidia.com/v2/resources/nvidia/nnunet_for_pytorch/versions/$VERSION/zip -O nnunet_for_pytorch_$VERSION.zip
 unzip nnunet_for_pytorch_21.11.0.zip
 
-#sed 's/pytorch-lightning==1.3.8/pytorch-lightning==1.5.0/g' requirements.txt > temp_file && mv temp_file requirements.txt
+sed 's/pytorch-lightning==1.3.8/pytorch-lightning==1.6.0/g' requirements.txt > temp_file && mv temp_file requirements.txt
 pip install --disable-pip-version-check -r requirements.txt
 pip install monai==0.8.0 --no-dependencies
 pip uninstall -y torchtext 
-- 
GitLab