From 9d6ddcc394600de70a78a53290b090f69ffa5906 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Weder Date: Fri, 4 Jul 2025 15:22:56 +0200 Subject: [PATCH] Bugfix if only using a cpu Two of the models were always initialized on the GPU, even when 'CPU' was selected. Now they are initialized on the CPU, and thus the crash is prevented if PyTorch was installed only for the CPU. --- inference/act_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inference/act_model.py b/inference/act_model.py index e0e2442..496adbf 100755 --- a/inference/act_model.py +++ b/inference/act_model.py @@ -50,8 +50,8 @@ def __init__(self, rate=0.0, alpha=0.4, device="cuda:0"): super(ActivityModel, self).__init__() self.alpha = alpha - self.kcat_model = KcatModel().to(device) - self.Km_model = KmModel().to(device) + self.kcat_model = KcatModel(device = device).to(device) + self.Km_model = KmModel(device = device).to(device) self.prot_norm = nn.BatchNorm1d(1024).to(device) self.molt5_norm = nn.BatchNorm1d(768).to(device)