facebookresearch / svoice

We provide a PyTorch implementation of the paper Voice Separation with an Unknown Number of Multiple Speakers In which, we present a new method for separating a mixed audio sequence, in which multiple voices speak simultaneously. The new method employs gated neural networks that are trained to separate the voices at multiple processing steps, while maintaining the speaker in each output channel fixed. A different model is trained for every number of possible speakers, and the model with the largest number of speakers is employed to select the actual number of speakers in a given sample. Our method greatly outperforms the current state of the art, which, as we show, is not competitive for more than two speakers.
Other
1.26k stars 181 forks source link

Run separate on cpu only device #35

Closed chrisdrake112 closed 2 years ago

chrisdrake112 commented 3 years ago

Hey Im looking to run the script separate on a CPU only device. I have set the map _location to cpu in site-packages/torch/serialization.py but still get the error: RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU. I would appreciate any advice thanks :) also the program is amazing.

adamfils commented 3 years ago

In the separate.py line 88 use this

pkg = torch.load(args.model_path, map_location='cpu')

chrisdrake112 commented 3 years ago

hey I just tried that and got : Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from. Is there another step I should take? Thanks for your reply.

adamfils commented 3 years ago

I couldn't run it on CPU either I had to use a machine with GPU Try Colab

adiyoss commented 3 years ago

Hi @adamfils and @chrisdrake112, You can train your model on a cpu by setting the argument device=cpu. It will probably be significantly slower but should work

chrisdrake112 commented 3 years ago

hey @adamfils I have a model trained but we would like to run the separate script off of the cluster. Is there a way to do this on a cpu only machine?

Yang-Xijie commented 2 years ago

Hi @adamfils and @chrisdrake112, You can train your model on a cpu by setting the argument device=cpu. It will probably be significantly slower but should work

Sorry but how can I then access the model (on a computer only with CPU)?

It seems that models/ will store the generated model. However, with device=cpu, ddp=1 cannot be set.

$ python train.py ddp=1

[2021-12-17 13:58:05,639][__main__][INFO] - For logs, checkpoints and samples check /Users/yan.../github-projects/svoice/outputs/exp_
[2021-12-17 13:58:06,418][svoice.executor][ERROR] - DDP is only available on GPU. Make sure GPUs are properly configured with cuda.
adiyoss commented 2 years ago

@Yang-Xijie, Distributed Data Parallel generates a distributed training for GPU only. In case you are training on CPU (which will probably take forever to converge) you only option at the moment is a single CPU training.

adiyoss commented 2 years ago

I will close this issue as there is not new comments for a while. Feel free to reopen it if needed.