leimao / Voice-Converter-CycleGAN

Voice Converter Using CycleGAN and Non-Parallel Data
https://leimao.github.io/project/Voice-Converter-CycleGAN/
MIT License
526 stars 127 forks source link

preprocess.py:170: RuntimeWarning: divide by zero encountered in log #29

Open salisbury-espinosa opened 4 years ago

salisbury-espinosa commented 4 years ago
Voice_Converter_CycleGAN/preprocess.py:170: RuntimeWarning: divide by zero encountered in log
  f0_converted = np.exp((np.log(f0) - mean_log_src) / std_log_src * std_log_target + mean_log_target)
Srivatsank1 commented 4 years ago

Use np.log(f0.clip(min = minval)) where you can use an infinitesimally small value as a minval. About 1e-5 works well. If you still have any issues, let me know.

Voice_Converter_CycleGAN/preprocess.py:170: RuntimeWarning: divide by zero encountered in log
  f0_converted = np.exp((np.log(f0) - mean_log_src) / std_log_src * std_log_target + mean_log_target)