diff --git a/synapse_net/inference/util.py b/synapse_net/inference/util.py index 2499d05a..09c771da 100644 --- a/synapse_net/inference/util.py +++ b/synapse_net/inference/util.py @@ -219,7 +219,7 @@ def get_prediction_torch_em( if os.path.isdir(model_path): # Load the model from a torch_em checkpoint. model = torch_em.util.load_model(checkpoint=model_path, device=device) else: # Load the model directly from a serialized pytorch model. - model = torch.load(model_path) + model = torch.load(model_path, weights_only=False) # Run prediction with the model. with torch.no_grad():