magphase icon indicating copy to clipboard operation
magphase copied to clipboard

run copy_syn error

Open KnowBetterHelps opened this issue 7 years ago • 7 comments

when I run demo_copy_synthesis_lossless.py or demo_copy_synthesis_low_dim.py or 2_batch_wave_generation.py I always get the following error: A value in x_new is above the interpolation range

Analysing..................................................... Extracting epochs with REAPER... Residual symmetry: P:2120.314453 N:1149.693604 MEAN:0.606241 Inverting signal Synthesising................................................. Traceback (most recent call last): File "./demo_copy_synthesis_low_dim.py", line 74, in v_syn_sig = mp.synthesis_from_compressed(m_mag_mel_log, m_real_mel, m_imag_mel, v_lf0, fs, fft_len) File "/home/huawei/magphase-master/src/magphase.py", line 530, in synthesis_from_compressed m_real_mel = f_intrp_real(np.arange(ncoeffs_mag)) File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/polyint.py", line 79, in call y = self._evaluate(x) File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py", line 498, in _evaluate out_of_bounds = self._check_bounds(x_new) File "/usr/local/lib/python2.7/dist-packages/scipy/interpolate/interpolate.py", line 528, in _check_bounds raise ValueError("A value in x_new is above the interpolation " ValueError: A value in x_new is above the interpolation range.

and I found that labs_var_rate/ file is always empty, can you give me some help? ^_^

KnowBetterHelps avatar Nov 22 '17 09:11 KnowBetterHelps

Hi, I am not having any problems. I think that you are using an old version of MagPhase. So, please download the current version from the master branch.

Also, upgrade the required python packages to their latest versions, just in case.

Let me know how it goes. Thanks

felipeespic avatar Nov 22 '17 15:11 felipeespic

Hi Felipe, I hit the same problem. I have absolutely the latest MagPhase from master, and all my packages appear to be up-to-date.

Happy to help look into this. Let me know what I can do.

BTW the lossless synthesis ran without a problem

mikenewman1 avatar Nov 28 '17 19:11 mikenewman1

If I hack around this by editing magphase.py, it runs to completion with no obvious harm to the synthesized file

-    f_intrp_real = interpolate.interp1d(np.arange(ncoeffs_comp), m_real_mel, kind='nearest', fill_value='extrapolate')
-    f_intrp_imag = interpolate.interp1d(np.arange(ncoeffs_comp), m_imag_mel, kind='nearest', fill_value='extrapolate')
-    
+    f_intrp_real = interpolate.interp1d(np.arange(ncoeffs_comp), m_real_mel, kind='nearest', fill_value=0.0, bounds_error=False)
+    f_intrp_imag = interpolate.interp1d(np.arange(ncoeffs_comp), m_imag_mel, kind='nearest', fill_value=0.0, bounds_error=False)
+

mikenewman1 avatar Nov 28 '17 19:11 mikenewman1

Hi Mike,

I am pretty sure that it is because your SciPy package is not updated. Update it with pip install scipy --upgrade

Let me know how it goes. Thanks

felipeespic avatar Nov 28 '17 21:11 felipeespic

Sorry, that does not fix it (though you are right I did not have the latest version) I tried the same with the other packages and still no luck.

mikenewman1 avatar Nov 28 '17 22:11 mikenewman1

FYI I was able to make this error go away by running on a (different) machine, that was configured for building with Merlin (in particular after running pip install -r requirements.txt in the merlin directory, but also other stuff) But I don't know which package did the trick....

mikenewman1 avatar Nov 30 '17 15:11 mikenewman1

@mikenewman1 , I think it is any of these ones: numpy, scipy, or scikit-learn. Try updating (pip install <package> --ugrade) each of these.

felipeespic avatar Dec 02 '17 15:12 felipeespic