fishaudio / fish-diffusion

An easy to understand TTS / SVS / SVC framework
https://diff.fish.audio
MIT License
635 stars 81 forks source link

数据预处理问题(bug?) #61

Closed Yurzi closed 1 year ago

Yurzi commented 1 year ago
rgument self in method wrapper_CUDA_Tensor_searchsorted)
  1%|▋                                                                                                  | 45/7110 [00:37<32:55,  3.58it/s]2023-04-05 20:21:32.660 | ERROR    | __main__:safe_process:198 - Error processing dataset/train/opencpop/2082003011.wav
2023-04-05 20:21:32.660 | ERROR    | __main__:safe_process:199 - Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument self in method wrapper_CUDA_Tensor_searchsorted)
Traceback (most recent call last):

  File "/mnt/fish-diffusion/tools/preprocessing/extract_features.py", line 245, in <module>
    i = safe_process(args, config, audio_path)
        │            │     │       └ PosixPath('dataset/train/opencpop/2082003011.wav')
        │            │     └ Config (path: configs/svc_hifisinger_finetune.py): {'sampling_rate': 44100, 'hidden_size': 256, 'vocoder_config': {'sampling_...
        │            └ Namespace(config='configs/svc_hifisinger_finetune.py', path='dataset/train', clean=True, num_workers=1, no_augmentation=False)
        └ <function safe_process at 0x7fa72e5d3640>

> File "/mnt/fish-diffusion/tools/preprocessing/extract_features.py", line 166, in safe_process
    process(config, audio_path)
    │       │       └ PosixPath('dataset/train/opencpop/2082003011.wav')
    │       └ Config (path: configs/svc_hifisinger_finetune.py): {'sampling_rate': 44100, 'hidden_size': 256, 'vocoder_config': {'sampling_...
    └ <function process at 0x7fa72e5d3130>

  File "/mnt/fish-diffusion/tools/preprocessing/extract_features.py", line 148, in process
    pitches = pitch_extractor(audio, sr, pad_to=mel_length)
              │               │      │          └ 455
              │               │      └ 44100
              │               └ tensor([[ 0.0017,  0.0017,  0.0018,  ..., -0.0013, -0.0010, -0.0006]],
              │                        device='cuda:0')
              └ <fish_diffusion.modules.pitch_extractors.parsel_mouth.ParselMouthPitchExtractor object at 0x7fa71f22bbb0>

  File "/mnt/fish-diffusion/fish_diffusion/modules/pitch_extractors/parsel_mouth.py", line 42, in __call__
    return self.post_process(x, sampling_rate, f0, pad_to)
           │    │            │  │              │   └ 455
           │    │            │  │              └ array([   0.        ,    0.        ,    0.        ,    0.        ,
           │    │            │  │                          0.        ,    0.        ,  414.08354111,  416.3...
           │    │            │  └ 44100
           │    │            └ tensor([[ 0.0017,  0.0017,  0.0018,  ..., -0.0013, -0.0010, -0.0006]],
           │    │                     device='cuda:0')
           │    └ <function BasePitchExtractor.post_process at 0x7fa72e5d2b90>
           └ <fish_diffusion.modules.pitch_extractors.parsel_mouth.ParselMouthPitchExtractor object at 0x7fa71f22bbb0>

  File "/mnt/fish-diffusion/fish_diffusion/modules/pitch_extractors/builder.py", line 59, in post_process
    return interpolate(time_frame, time_org, f0, left=f0[0], right=f0[-1])
           │           │           │         │        │            └ tensor([ 414.0835,  416.3744,  420.1241,  424.6104,  428.1972,  429.9621,
           │           │           │         │        │                       429.6776,  427.2525,  420.7615,  410.0335,...
           │           │           │         │        └ tensor([ 414.0835,  416.3744,  420.1241,  424.6104,  428.1972,  429.9621,
           │           │           │         │                   429.6776,  427.2525,  420.7615,  410.0335,...
           │           │           │         └ tensor([ 414.0835,  416.3744,  420.1241,  424.6104,  428.1972,  429.9621,
           │           │           │                    429.6776,  427.2525,  420.7615,  410.0335,...
           │           │           └ tensor([0.0697, 0.0813, 0.0929, 0.1045, 0.1161, 0.1277, 0.1393, 0.1509, 0.1625,
           │           │                     0.1741, 0.1858, 0.1974, 0.2090, 0.220...
           │           └ tensor([0.0000, 0.0116, 0.0232, 0.0348, 0.0464, 0.0580, 0.0697, 0.0813, 0.0929,
           │                     0.1045, 0.1161, 0.1277, 0.1393, 0.150...
           └ <function interpolate at 0x7fa731706710>

  File "/mnt/fish-diffusion/fish_diffusion/utils/tensor.py", line 67, in interpolate
    i = torch.clip(torch.searchsorted(xp, x, right=True), 1, len(xp) - 1)
        │     │    │     │            │   │                      └ tensor([0.0697, 0.0813, 0.0929, 0.1045, 0.1161, 0.1277, 0.1393, 0.1509, 0.1625,
        │     │    │     │            │   │                                0.1741, 0.1858, 0.1974, 0.2090, 0.220...
        │     │    │     │            │   └ tensor([0.0000, 0.0116, 0.0232, 0.0348, 0.0464, 0.0580, 0.0697, 0.0813, 0.0929,
        │     │    │     │            │             0.1045, 0.1161, 0.1277, 0.1393, 0.150...
        │     │    │     │            └ tensor([0.0697, 0.0813, 0.0929, 0.1045, 0.1161, 0.1277, 0.1393, 0.1509, 0.1625,
        │     │    │     │                      0.1741, 0.1858, 0.1974, 0.2090, 0.220...
        │     │    │     └ <built-in method searchsorted of type object at 0x7fa79fea4880>
        │     │    └ <module 'torch' from '/opt/miniconda/envs/fish/lib/python3.10/site-packages/torch/__init__.py'>
        │     └ <built-in method clip of type object at 0x7fa79fea4880>
        └ <module 'torch' from '/opt/miniconda/envs/fish/lib/python3.10/site-packages/torch/__init__.py'>

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument self in method wrapper_CUDA_Tensor_searchsorted)

在 CUDA 12.1的机子上抛出了这个错误

Wed Apr  5 20:25:55 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.30.02              Driver Version: 530.30.02    CUDA Version: 12.1     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  Tesla V100-SXM2-32GB            Off| 00000000:00:08.0 Off |                    0 |
| N/A   34C    P0               53W / 300W|      0MiB / 32768MiB |      1%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

不知道是什么问题捏

Yurzi commented 1 year ago

60 这个pr好像能解决这个问题qwq....