mirror of
https://github.com/macaodha/batdetect2.git
synced 2025-06-29 22:51:58 +02:00
fix: move spectrogram to cpu when plotting
This commit is contained in:
parent
616a24347d
commit
715db9a110
@ -61,7 +61,7 @@ def spectrogram(
|
|||||||
"""
|
"""
|
||||||
# Convert to numpy array if needed
|
# Convert to numpy array if needed
|
||||||
if isinstance(spec, torch.Tensor):
|
if isinstance(spec, torch.Tensor):
|
||||||
spec = spec.numpy()
|
spec = spec.detach().cpu().numpy()
|
||||||
|
|
||||||
# Remove batch and channel dimensions if present
|
# Remove batch and channel dimensions if present
|
||||||
spec = spec.squeeze()
|
spec = spec.squeeze()
|
||||||
|
Loading…
Reference in New Issue
Block a user