From aa44776ea0637f07966f2754e6301d78bce2c3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BCgler?= Date: Wed, 21 Jan 2026 17:29:13 +0100 Subject: [PATCH] Quick fix to address warning in run_prediction.py This Commit fixes the following warning by manually converting to a ndarray ``` /fastsurfer/FastSurferCNN/run_prediction.py:243: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:203.) ``` --- FastSurferCNN/run_prediction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FastSurferCNN/run_prediction.py b/FastSurferCNN/run_prediction.py index 7f10855b..371048e2 100644 --- a/FastSurferCNN/run_prediction.py +++ b/FastSurferCNN/run_prediction.py @@ -240,7 +240,7 @@ def __init__( f"Could not find the ColorLUT in {lut}, please make sure the --lut argument is valid." ) from err self.labels = self.lut["ID"].values - self.torch_labels = torch.from_numpy(self.lut["ID"].values) + self.torch_labels = torch.from_numpy(np.asarray(self.lut["ID"].values)) self.names = ["SubjectName", "Average", "Subcortical", "Cortical"] self.cfg_fin, cfg_cor, cfg_sag, cfg_ax = args2cfg(cfg_ax, cfg_cor, cfg_sag, batch_size=batch_size) # the order in this dictionary dictates the order in the view aggregation