GithubHelp home page GithubHelp logo

Comments (9)

fatchord avatar fatchord commented on July 17, 2024

@vitaly-zdanevich Yes you can. I would recommend opening up the repo in a decent IDE and using the search and replace functionality across all files:

".cuda()" replaced with an empty string ""

You should be able to run everything on CPU after that small change.

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

Removed ".cuda()" with find . -type f -exec sed -i 's/.cuda()//g' {} + (you can check before and after with grep -r ".cuda()" .), but looks like this is not enough:

$ python3 quick_start.py 

Initialising WaveRNN Model...

Trainable Parameters: 4.481M

Loading Weights: "quick_start/voc_weights/latest_weights.pyt"

Traceback (most recent call last):
  File "quick_start.py", line 62, in <module>
    voc_model.restore('quick_start/voc_weights/latest_weights.pyt')
  File "/home/vitaly_zdanevich/WaveRNN/models/fatchord_wavernn.py", line 375, in restore
    self.load(path)
  File "/home/vitaly_zdanevich/WaveRNN/models/fatchord_wavernn.py", line 378, in load
    self.load_state_dict(torch.load(path), strict=False)
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 368, in load
    return _load(f, map_location, pickle_module)
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 542, in _load
    result = unpickler.load()
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 505, in persistent_load
    data_type(size), location)
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 114, in default_restore_location
    result = fn(storage, location)
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 95, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/torch/serialization.py", line 79, in validate_cuda_device
    raise RuntimeError('Attempting to deserialize object on a CUDA '
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='cpu' to map your storages to the CPU.

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

Ok I edited models/fatchord_wavernn.py at line 378 and models/tacotron.py at 411 (was: torch.load(path), now: torch.load(path, map_location='cpu')).

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

Without CUDA speech synthesis is slow, I will try to use a machine with CUDA. Just asking - no way to increase rendering speed? Maybe it is possible to decrease a quality somehow?

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

I want some TTS on AWS Lambda, but this technology does not support CUDA.

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

image

Tried on CUDA, yes it much faster, but I see that from 8 CPU cores only one is busy, just saying.

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

Tried instance on Google Cloud with 4 GPUs with CUDA - looks like the same performance. @fatchord is it correct that only one GPU is used anyway?

time python3 quick_start.py -u --input_text "What will happen if I run this command?"
/home/vitaly_zdanevich/.local/lib/python3.6/site-packages/numba/errors.py:105: UserWarning: Insufficiently recent colorama version found. Numba requires colorama >= 0.3.9
  warnings.warn(msg)

Initialising WaveRNN Model...

Trainable Parameters: 4.481M

Loading Weights: "quick_start/voc_weights/latest_weights.pyt"


Initialising Tacotron Model...

Trainable Parameters: 11.078M

Loading Weights: "quick_start/tts_weights/latest_weights.pyt"

+---------+---------------+-----------------+----------------+-----------------+
| WaveRNN | Tacotron(r=1) | Generation Mode | Target Samples | Overlap Samples |
+---------+---------------+-----------------+----------------+-----------------+
|  804k   |     196k      |    Unbatched    |      N/A       |       N/A       |
+---------+---------------+-----------------+----------------+-----------------+
 

| Generating 1/1
| ████████████████ 54400/54450 | Batch Size: 1 | Gen Rate: 1kHz | 

Done.


real    0m53.960s
user    0m43.638s
sys     0m10.492s

from wavernn.

vitaly-zdanevich avatar vitaly-zdanevich commented on July 17, 2024

@fatchord maybe it is possible to use GPUs and multiple CPU cores?

from wavernn.

TheButlah avatar TheButlah commented on July 17, 2024

Switching between single GPU and cpu training has been added as of #107

from wavernn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.