tsurumeso / vocal-remover

Vocal Remover using Deep Neural Networks
MIT License
1.55k stars 222 forks source link

Error about 'cfloat' in the runtime of inference #175

Open fu-wen-bin opened 7 months ago

fu-wen-bin commented 7 months ago

What was happening? Thanks sooooo much!

Window size: 512
Model: HP2-4BAND-3090_4band_arch-500m_1
Parameter: 4band_44100
Aggressiveness: 0.3
High end process: mirroring2
TTA: True
Deep Extraction: False

loading model... done
stft of wave source... done
100% 15/15 [00:08<00:00,  1.75it/s]
100% 16/16 [00:08<00:00,  1.97it/s]
Traceback (most recent call last):
  File "/content/drive/MyDrive/VocalRemover5-COLAB_arch/main.py", line 307, in <module>
    main()
  File "/content/drive/MyDrive/VocalRemover5-COLAB_arch/main.py", line 302, in main
    process.inference()
  File "/content/drive/MyDrive/VocalRemover5-COLAB_arch/main.py", line 122, in inference
    y_wave = spec_utils.cmb_spectrogram_to_wave(y_spec_m, mp, input_high_end_h, input_high_end_)  
  File "/content/drive/MyDrive/VocalRemover5-COLAB_arch/lib/spec_utils.py", line 340, in cmb_spectrogram_to_wave
    wave = librosa.resample(spectrogram_to_wave(spec_s, bp['hl'], mp, False), bp['sr'], sr, res_type="sinc_fastest")
  File "/content/drive/MyDrive/VocalRemover5-COLAB_arch/lib/spec_utils.py", line 297, in spectrogram_to_wave
    wave_left = librosa.istft(spec_left, hop_length=hop_length)
  File "/usr/local/lib/python3.10/dist-packages/librosa/util/decorators.py", line 88, in inner_f
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/librosa/core/spectrum.py", line 394, in istft
    dtype = util.dtype_c2r(stft_matrix.dtype)
  File "/usr/local/lib/python3.10/dist-packages/librosa/util/decorators.py", line 88, in inner_f
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/librosa/util/utils.py", line 2185, in dtype_c2r
    np.dtype(complex): np.dtype(np.float).type,
  File "/usr/local/lib/python3.10/dist-packages/numpy/__init__.py", line 319, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?
Notebook took: 31.9s
packetbytebuf commented 2 weeks ago

pip install librosa --upgrade

the librosa version from requirements.txt uses an old version of numpy you can either downgrade numpy (wasnt working on my machine) or you could just upgrade librosa (which worked for me)