andabi / music-source-separation

Deep neural networks for separating singing voice from music written in TensorFlow
795 stars 150 forks source link

Error running train.py #15

Open groadabike opened 6 years ago

groadabike commented 6 years ago

/home/anaconda3/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "train.py", line 12, in from data import Data File "/home/music-source-separation/data.py", line 11, in from preprocess import get_random_wav File "/home/music-source-separation/preprocess.py", line 41 return np.array(map(lambda (m, p): griffin_lim(m, len_frame, len_hop, num_iters=num_iters, phase_angle=p), zip(mag, init_phase))) ^ SyntaxError: invalid syntax

Hi, I am getting this error when I try to run the training. I am using python3.6.

Thank you

conwayzhu commented 6 years ago

Hi,

I believe this is caused by a change in Python 3 with map, namely you need to do

np.array(list(map(lambda (m, p): griffin_lim(m, len_frame, len_hop, num_iters=num_iters, phase_angle=p))

to cast the map object to a list, so it can be converted into an np array.

iostreamrain commented 6 years ago

When I changed it like you said, It always say error. I used numpy==1.14.2, because I can't install numpy==1.3.0

(ENV) ➜ music-source-separation git:(master) ✗ python train.py Traceback (most recent call last): File "train.py", line 12, in from data import Data File "/home/rain/Python/voice/music-source-separation/data.py", line 11, in from preprocess import get_random_wav File "/home/rain/Python/voice/music-source-separation/preprocess.py", line 42 np.array(list(map(lambda (m, p): griffin_lim(m, len_frame, len_hop, num_iters=num_iters, phase_angle=p)) ^ SyntaxError: invalid syntax

iostreamrain commented 6 years ago

return np.array(map(lambda m: lambda p: griffin_lim(m, len_frame, len_hop, num_iters=num_iters, phase_angle=p), zip(mag, init_phase)))

It seems work.

jadujoel commented 6 years ago

Made a fork that works in python3 -> https://github.com/jadujoel/music-source-separation/tree/py3

ucasiggcas commented 5 years ago

you have the ikala data ? Or how to change the config.py with only mir-1k ? Could U help me ? Please .

Thx

Lychee Tsu