Jump to content

Could someone help me to write Colab notebook?

Zelenooki

Hi to all! This is my first post, I hope someone of members will help me...

I am trying to setup google Colab notebook with gpu support for open source separation written in python:
https://github.com/facebookresearch/demucs

but always getting this error

 

Quote

"Separating track /content/drive/testfile.flac 0%| | 0/210 [00:00<?, ?seconds/s]Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/content/demucs/demucs/separate.py", line 166, in main() File "/content/demucs/demucs/separate.py", line 155, in main sources = apply_model(model, wav, shifts=args.shifts, split=args.split, progress=True) File "/content/demucs/demucs/utils.py", line 119, in apply_model chunk_out = apply_model(model, chunk, shifts=shifts) File "/content/demucs/demucs/utils.py", line 140, in apply_model out = model(padded.unsqueeze(0))[0] File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/content/demucs/demucs/model.py", line 198, in forward x = encode(x) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 202, in forward self.padding, self.dilation, self.groups) **RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same**


I am 99%sure that have done all steps to install demucs conda envioment properly
Googled and search topics about error, and seems there need to be model demucs called by cuda.

On pytorch forum, members told me:

"It sounds like you forgot to allocate either the input or the layer in gpu. Tensors in gpu are of type cuda.floatensor meanwhile tensors in cpu are just floatensor

When you’re training with a GPU, both the model and the data, as well as the loss function you use, must be in the same GPU.

You’re probably forgetting to pass one of these to your GPU.

"

but whatever I try keep pushing same error :/

 

It would be awesome if some of you, good in programming could properly wite Google Colab Notebook for Demucs.

 

Ready for donate for that!

 

thank you

Link to comment
Share on other sites

Link to post
Share on other sites

Can you post the code that you have, either directly on the forum or as a link to your notebook? The person on the pytorch forum sounds right to me - the error is that the input data is on the GPU, but it's trying to use it with a network that is on the CPU, and you can't do that.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×