KimythAnly / AGAIN-VC

This is the official implementation of the paper AGAIN-VC: A One-shot Voice Conversion using Activation Guidance and Adaptive Instance Normalization.
https://kimythanly.github.io/AGAIN-VC-demo/index
MIT License
111 stars 19 forks source link

about inference #8

Closed chikiuso closed 1 year ago

chikiuso commented 3 years ago

Hi, I tried to run the inference by default settings, it shows the following :

IndexError: cannot do a non-empty take from an empty axes.

may I have any hints to solve it? thanks.

KimythAnly commented 3 years ago

Could you provide the entire error message?

junaedifahmi commented 3 years ago

may be the error is something like this

Traceback (most recent call last):
  File "inference.py", line 56, in <module>
    inferencer.inference(source_path=args.source, target_path=args.target, out_path=args.output, seglen=args.seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 128, in inference
    Dsp.plot_spectrogram(dec.squeeze().cpu().numpy(), output_plt)
  File "/data/jun/voice_conversion/AGAIN-VC/util/dsp.py", line 98, in plot_spectrogram
    librosa.display.specshow(mag, x_axis='off', cmap='viridis')
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/librosa/display.py", line 713, in specshow
    kwargs.setdefault('cmap', cmap(data))
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/librosa/display.py", line 348, in cmap
    max_val = np.percentile(data, max_p)
  File "<__array_function__ internals>", line 6, in percentile
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/lib/function_base.py", line 3733, in percentile
    a, q, axis, out, overwrite_input, interpolation, keepdims)
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/lib/function_base.py", line 3853, in _quantile_unchecked
    interpolation=interpolation)
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/lib/function_base.py", line 3429, in _ureduce
    r = func(a, **kwargs)
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/lib/function_base.py", line 3967, in _quantile_ureduce_func
    x1 = take(ap, indices_below, axis=axis) * weights_below
  File "<__array_function__ internals>", line 6, in take
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 191, in take
    return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
    return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.

I also got that error when trying to do the inference. I tried to add the --seglen with the same parameter with my preprocessor config but it produces this error

Traceback (most recent call last):
  File "inference.py", line 56, in <module>
    inferencer.inference(source_path=args.source, target_path=args.target, out_path=args.output, seglen=args.seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 116, in inference
    self.process_wave_data(source, seglen=seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 97, in process_wave_data
    wav_data[feat] = wav_data[feat][:,:seglen]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
KimythAnly commented 3 years ago

may be the error is something like this

Traceback (most recent call last):
  File "inference.py", line 56, in <module>
    inferencer.inference(source_path=args.source, target_path=args.target, out_path=args.output, seglen=args.seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 128, in inference
   ...
  File "/data/jun/voice_conversion/AGAIN-VC/venv/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
    return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.

Hi, could you check what shape is dec before Dsp.plot_spectrogram(dec.squeeze().cpu().numpy(), output_plt)?

I also got that error when trying to do the inference. I tried to add the --seglen with the same parameter with my preprocessor config but it produces this error

Traceback (most recent call last):
  File "inference.py", line 56, in <module>
    inferencer.inference(source_path=args.source, target_path=args.target, out_path=args.output, seglen=args.seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 116, in inference
    self.process_wave_data(source, seglen=seglen)
  File "/data/jun/voice_conversion/AGAIN-VC/agent/inferencer.py", line 97, in process_wave_data
    wav_data[feat] = wav_data[feat][:,:seglen]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Similarly, could you check what shape is wav_data[feat] before wav_data[feat] = wav_data[feat][:,:seglen]?