Thank you for answering.
I should say that data and target are lists containing tensors.
I tried to do what you said, so I update code.  I update code.

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/Antonio López León/Documents/Universidad/TFG/PROYECTO/BBDD/audioCQT/ProcesamientoNN.py", line 102, in <module>
    for batch_idx, (x,y) in enumerate(train_loader):

  File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 615, in __next__
    batch = self.collate_fn([self.dataset[i] for i in indices])

  File "C:/Users/Antonio López León/Documents/Universidad/TFG/PROYECTO/BBDD/audioCQT/ProcesamientoNN.py", line 65, in music_collate_fn
    return torch.tensor(data), torch.tensor(target)

ValueError: only one element tensors can be converted to Python scalars