madebyollin / acapellabot

Acapella Extraction with a ConvNet
http://madebyoll.in/posts/cnn_acapella_extraction/
205 stars 45 forks source link

AssertionError: AbstractConv2d Theano optimization failed #3

Open ghoshaw opened 7 years ago

ghoshaw commented 7 years ago

I have been through the error of #1, and solved follow the answer. but, I come to a new error as follows: AssertionError: AbstractConv2d Theano optimization failed: there is no implementation available supporting the requested options. Did you exclude both "conv_dnn" and "conv_gemm" from the optimizer? If on GPU, is cuDNN available and does the GPU support it? If on CPU, do you have a BLAS library installed Theano can link against?

I searched answers in google , but not helped. Does anyone know what to do ?

madebyollin commented 7 years ago

Make sure that you're using Theano 0.9.0 (python -c 'import theano; print(theano.__version__)' should print 0.9.0.something).

Make sure you've followed all of the Theano installation instructions. Specifically, if you're using a GPU, that means running conda install pygpu or installing cuDNN (although I think cuDNN support is getting phased out). If using a CPU, that means running conda install mkl-service.

I think this issue on the Keras tracker (and maybe this one) should help.

ghoshaw commented 7 years ago

Thanks, I solved this problem by add 'optimizer = None ' in .theanorc. But I come to a new problem. I don't know if it is because I use theano 0.8.2. In line 24 of conversion.py, newX is float and can not be as index. so I use int(newX), but the it comes to " newSpectrogram[:spectrogram.shape[0], :spectrogram.shape[1]] = spectrogram ValueError: could not broadcast input array from shape (769,21859) into shape (768,21856) "

That is the size is not right, so I change it to " newSpectrogram[:newX, :newY] = spectrogram[:newX, :newY] " and it seems to work, but I run few hours and it is still running and gets nothing. Is that reasonable?

madebyollin commented 7 years ago

Hmm. It should be able to do the isolation process in ~30s or so, at least on a GPU. Are you using python 3? I've only tested on python 3.

If you're determined to make it work on py2, first make sure that the spectrograms that expandToGrid is returning are padded to multiples of gridSize. The point of that method is to pad the spectrograms to a nice size so that the network can handle them (they get cropped after getting output). If that works, then everything else should work.

It's not clear to me how things could run for hours unless you're training–could you show the output for the case where it hangs?

ghoshaw commented 7 years ago

sorry, I used python 2. I will try this again with python 3.

ghoshaw commented 7 years ago

Thanks for your patience. I am a little confused about the file names of the train samples, could you game me some examples? Thanks very much.

2017-05-02

ghoshaw

发件人:Ollin Boer Bohan notifications@github.com 发送时间:2017-04-28 01:38 主题:Re: [madebyollin/acapellabot] AssertionError: AbstractConv2d Theano optimization failed (#3) 收件人:"madebyollin/acapellabot"acapellabot@noreply.github.com 抄送:"ghoshaw"ghoshaw@163.com,"Author"author@noreply.github.com

Hmm. It should be able to do the isolation process in ~30s or so, at least on a GPU. Are you using python 3? I've only tested on python 3. If you're determined to make it work on py2, first make sure that the spectrograms that expandToGrid is returning are padded to multiples of gridSize. The point of that method is to pad the spectrograms to a nice size so that the network can handle them (they get cropped after getting output). If that works, then everything else should work. It's not clear to me how things could run for hours unless you're training. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

madebyollin commented 7 years ago

You can configure the file parsing code however you want for your dataset by messing with the functions at the top of data.py. Some examples of valid filenames for the format I'm using are:

5 Lana Del Rey - Young & Beautiful [Acapella].mp3 5 Dubvision - Triton.mp3 11 Borgeous - Invincible [Acapella].mp3 11 Carta - Shanghai.mp3

The number at the start is the camelot key (without the A/B).

Files are mashed up (combined to form a set of training examples) if they start with the same number, and only mashed up if one is an acapella and the other is not. So the data that would be generated is:

x : (Lana Del Rey - Young & Beautiful [Acapella]) + (Dubvision - Triton) -> y: (Lana Del Rey - Young & Beautiful [Acapella]) x : (Borgeous - Invincible [Acapella]) + (Carta - Shanghai) -> y: (Borgeous - Invincible [Acapella])

Where (x, y) are sets of input, output pairs for the model.

The reason the data is generated this way is that it allows me to make a lot of data with fewer examples, while still keeping the training data realistic (i.e. the vocals are always in the same key as the song).

To get key information you can use KeyFinder or other software tools. I haven't tested performance with/without key matching though; it's possible that you could just give everything the same key and still get good results. I hope that helps!

ghoshaw commented 7 years ago

Thanks very much, this helps a lot!

2017-05-03

ghoshaw

发件人:Ollin Boer Bohan notifications@github.com 发送时间:2017-05-03 00:20 主题:Re: [madebyollin/acapellabot] AssertionError: AbstractConv2d Theano optimization failed (#3) 收件人:"madebyollin/acapellabot"acapellabot@noreply.github.com 抄送:"ghoshaw"ghoshaw@163.com,"Author"author@noreply.github.com

You can configure the file parsing code however you want for your dataset by messing with the functions at the top of data.py. Some examples of valid filenames for the format I'm using are: 5 Lana Del Rey - Young & Beautiful [Acapella].mp3 5 Dubvision - Triton.mp3 11 Borgeous - Invincible [Acapella].mp3 11 Carta - Shanghai.mp3 Files are mashed up (combined to form a set of training examples) if they start with the same number, and only mashed up if one is an acapella and the other is not. So the data that would be generated is: x : (Lana Del Rey - Young & Beautiful [Acapella]) + (Dubvision - Triton) -> y: (Lana Del Rey - Young & Beautiful [Acapella]) x : (Borgeous - Invincible [Acapella]) + (Carta - Shanghai) -> y: (Borgeous - Invincible [Acapella]) Where (x, y) are sets of input, output pairs for the model. The reason the data is generated this way is that it allows me to make a lot of data with fewer examples, while still keeping the training data realistic (i.e. the vocals are always in the same key as the song). To get key information you can use KeyFinder or other software tools. I haven't tested performance with/without key matching though; it's possible that you could just give everything the same key and still get good results. I hope that helps! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Khalidhussain1134 commented 6 years ago

I am also having this error AssertionError: AbstractConv2d Theano optimization failed: there is no implementation available supporting the requested options. Did you exclude both "conv_dnn" and "conv_gemm" from the optimizer? If on GPU, is cuDNN available and does the GPU support it? If on CPU, do you have a BLAS library installed Theano can link against?

I am working with keras 1.0 and theano 0.8.0 in windows

According to #ghoshaw I cannot locate the file .theanorc to set optimizer =None as by ghoshaw,

Any one can help me, Thanks

alchemz commented 6 years ago

@ghoshaw, could you help find the .theanorc file? Thanks!

Khalidhussain1134 commented 6 years ago

@ghoshaw it will be your great favor if you can help us to locate .theanorc file, thanks

ghoshaw commented 6 years ago

@alchemz , Sorry, I do not know where the .theanorc file is, but you can try to create one in ~/.theano if you can not find it.

ThomasWarn commented 5 years ago

According to some it's in "C:\Users\USERNAME.theanorc.txt".

Mine wasn't there and I still haven't fixed my problem but hopefully this will help someone.