From e0b33a6e96d6838b7d2dda4b27b0c4ef74339127 Mon Sep 17 00:00:00 2001 From: Fabian Isensee Date: Thu, 23 May 2024 09:32:55 +0200 Subject: [PATCH] nnUNetTrainerBenchmark_5epochs now saves hostname as well --- .../variants/benchmarking/nnUNetTrainerBenchmark_5epochs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nnunetv2/training/nnUNetTrainer/variants/benchmarking/nnUNetTrainerBenchmark_5epochs.py b/nnunetv2/training/nnUNetTrainer/variants/benchmarking/nnUNetTrainerBenchmark_5epochs.py index fad1fff99..a76bb634c 100644 --- a/nnunetv2/training/nnUNetTrainer/variants/benchmarking/nnUNetTrainerBenchmark_5epochs.py +++ b/nnunetv2/training/nnUNetTrainer/variants/benchmarking/nnUNetTrainerBenchmark_5epochs.py @@ -1,3 +1,5 @@ +import subprocess + import torch from batchgenerators.utilities.file_and_folder_operations import save_json, join, isfile, load_json @@ -53,13 +55,15 @@ def on_train_end(self): else: old_results = {} # generate some unique key - my_key = f"{cudnn_version}__{torch_version.replace(' ', '')}__{gpu_name.replace(' ', '')}__gpus_{num_gpus}" + hostname = subprocess.getoutput('hostname') + my_key = f"{hostname}__{cudnn_version}__{torch_version.replace(' ', '')}__{gpu_name.replace(' ', '')}__num_gpus_{num_gpus}" old_results[my_key] = { 'torch_version': torch_version, 'cudnn_version': cudnn_version, 'gpu_name': gpu_name, 'fastest_epoch': fastest_epoch, 'num_gpus': num_gpus, + 'hostname': hostname } save_json(old_results, join(self.output_folder, 'benchmark_result.json'))