music-source-separation icon indicating copy to clipboard operation
music-source-separation copied to clipboard

ValueError: Sample larger than population or is negative

Open RahulRagesh opened this issue 7 years ago • 4 comments

File "train.py", line 95, in train() File "train.py", line 44, in train mixed_wav, src1_wav, src2_wav, _ = data.next_wavs(TrainConfig.SECONDS, TrainConfig.NUM_WAVFILE) File "D:\Machine Learning\Blind Audio Source Separation\Andabi\music-source-separation-master\data.py", line 22, in next_wavs wavfiles = random.sample(wavfiles, size) File "C:\Users\RAHUL\Anaconda3\lib\random.py", line 317, in sample raise ValueError("Sample larger than population or is negative") ValueError: Sample larger than population or is negative

I get this error on running train.py

RahulRagesh avatar Feb 13 '18 06:02 RahulRagesh

Check config.py, you need to modify the DATA_PATH in TrainConfig class.

divyamamgai avatar Mar 02 '18 10:03 divyamamgai

Check config.py, you need to modify the DATA_PATH in TrainConfig class.

Dear,

How to correct the DATA_PATH with auther's dataset ?

Thx

ucasiggcas avatar Apr 17 '19 09:04 ucasiggcas

Have you got any solutions yet ? What should we change to ?

alishibli97 avatar Aug 06 '19 00:08 alishibli97

hello every one, it means that number of your sample is larger than the file which you want to sample it, in this case that file name is 'wavfiles' in this source code

for solving this problem

just change this wavfiles = [] to wavfiles = ['address or directory of the wav file that you want to separate it'] in data.py file

have a good time.

Navids71 avatar Oct 09 '19 09:10 Navids71