From 715db9a1102166be23c7a082e76907eb9dada779 Mon Sep 17 00:00:00 2001 From: Santiago Martinez Date: Sat, 29 Apr 2023 15:39:45 +0100 Subject: [PATCH] fix: move spectrogram to cpu when plotting --- batdetect2/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batdetect2/plot.py b/batdetect2/plot.py index 62c4919..bf05cc8 100644 --- a/batdetect2/plot.py +++ b/batdetect2/plot.py @@ -61,7 +61,7 @@ def spectrogram( """ # Convert to numpy array if needed if isinstance(spec, torch.Tensor): - spec = spec.numpy() + spec = spec.detach().cpu().numpy() # Remove batch and channel dimensions if present spec = spec.squeeze()