How can I run Mozilla TTS/Coqui TTS training with CUDA on a Windows system? - text-to-speech

I have a machine with a Quadro P5000 graphics card, running Windows 10. I'd like to train a TTS voice on this system. What do I need to install to make this work?

Here's what to install/do:
Download and install Python 3.8 (not 3.9+) for Windows. During the installation, ensure that you:
Opt to install it for all users.
Opt to add Python to the PATH.
Download and install CUDA Toolkit 10.1 (not 11.0+).
Download "cuDNN v7.6.5 (November 5th, 2019), for CUDA 10.1" (not cuDNN v8+), extract it, and then copy what's inside the cuda folder into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1.
Download the latest 64-bit version of eSpeak NG (no version constraints :-) ).
Download the latest 64-bit version of Git for Windows (no version constraints :-) ).
Open a PowerShell prompt to a folder where you'd like to install Coqui TTS.
Run git clone https://github.com/coqui-ai/TTS.git.
Run cd TTS.
Run python -m venv ..
Run .\Scripts\pip install -e ..
Run the following command (this differs from the command you get from the PyTorch website because of a known issue):
.\Scripts\pip install torch==1.8.0+cu101 torchvision==0.9.0+cu101 torchaudio===0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
Put the following into a script called "test_cuda.py" in the TTS folder:
import torch
x = torch.rand(5, 3)
print(x)
print(torch.cuda.is_available())
Run the script via .\Scripts\python ./test_cuda.py and confirm the output looks like this (the first part should have just random numbers, but the last line must read True; if it does not, CUDA is not installed properly):
tensor([[0.2141, 0.7808, 0.9298],
[0.3107, 0.8569, 0.9562],
[0.2878, 0.7515, 0.5547],
[0.5007, 0.6904, 0.4136],
[0.2443, 0.4158, 0.4245]])
True
Put the following into a script called "train.bat" in the TTS folder, and then customize it for your configuration file:
set PYTHONIOENCODING=UTF-8
set PYTHONLEGACYWINDOWSSTDIO=UTF-8
set PHONEMIZER_ESPEAK_PATH=C:/Program Files/eSpeak NG/espeak-ng.exe
.\Scripts\python.exe ./TTS/bin/train_tacotron.py --config_path "C:/path/to/your/config.json"
Run the script via .\train.bat.
If you are using a different model than Tacotron or need to pass other parameters into the training script, feel free to further customize train.bat.
If you are just getting started with TTS training in general, take a peek at How do I get started training a custom voice model with Mozilla TTS on Ubuntu 20.04?.

Related

Unable to use Intel oneAPI DPCT for migration of my applicaiton: Error Code -5

I'm attempting to follow the instructions from this site https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-dpcpp-compatibility-tool/top.html. I receive an error when I use the dpct command, stating that the path for CUDA header files is incorrect. Now, in order to add the CUDA path, I must first install the CUDA toolkit, which I am unable to accomplish without sudo access and I don't have sudo privilege to my other server. Can someone please help me here.
dpct exited with code: -5 (Error: Path for CUDA header files is invalid or not available. Use --cuda-include-path to specify the correct path to the header files)
You can install CUDA toolkit in your home directory. You may find the instructions on the Nvidia official webpage that home directory installation doesn't require sudo.
Once you have installed the toolkit, use the below command to perform migration for a single source file as below:
dpct --cuda-include-path=/path/to/cuda/include sample.cu
Thanks,
Santosh

tfjs-node on old cpu (without AVX)

There is a desire to do the initial steps in tfjs using nodejs. At the moment, for tests, I can only use a computer with the following configuration:
Windows 7 SP1
8Gb Ram
e7500 (no AVX)
GeForce 750Ti
node v12.19.0
When using tfjs-node, I get the error:
return process.dlopen (module, path.toNamespacedPath (filename));
As far as I understand this is due to the fact that the processor is very old, without AVX.
Can I somehow rebuild tfjs-node to work on my processor, it would be ideal to build tfjs-node-gpu. If there is such an opportunity, what should I do for this?
I've come across assemblies from fo40225 (https://github.com/fo40225), but they are for Python.
Solved a problem.
First I tried changing Windows to Win10, it didn't help.
Therefore, I decided to rebuild tensorflow.dll. After many attempts, I came up with this setup:
Basel 3.1
Python 3.8
NumPy installed globally
VS BuildTools 2019
Tensorflow branch 2.3 compiled (bazel build -c opt // tensorflow / tools / lib_package: libtensorflow)
After that I copied the dll to the folder with node_modules \ #tensorflow \ tfjs-node \ lib \ napi-v6

Cannot import Selenium even when it's installed [duplicate]

After searching the web for hours i didnt yet find an answer to my problem. I am using Python 3.6 and i cant import selenium. I always get the message "No module named 'selenium''
I tried everything, i first downloaded selenium from this website https://pypi.python.org/pypi/selenium/3.6.0 .
Then I tried python -m pip install -U selenium and didnt work either. I tried some other things that people said but they didnt work either.
Im using windows 10.
Any help?
As you mentioned you are using Python 3.6 following the steps :
Open Command Line Interface (CLI) and issue the command python to check if Python is properly installed :
C:\Users\username>python
Python 3.6.1 (v3.6.1:69c0db5, Jan 16 2018, 17:54:52) [MSC v.1900 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Ensure pip is working properly :
C:\Users\username>pip
Usage:
pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form [user:passwd#]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
Install latest selenium through pip :
C:\Users\username>pip install -U selenium
Collecting selenium
Downloading selenium-3.8.1-py2.py3-none-any.whl (931kB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 942kB 322kB/s
Installing collected packages: selenium
Successfully installed selenium-3.8.1
Confirm that Selenium is installed :
C:\Users\username>pip freeze
selenium==3.8.1
Open an IDE (e.g Eclipse, PyCharm) and write a simple program as follows :
from selenium import webdriver
driver = webdriver.Firefox(executable_path="C:\\path\\to\\geckodriver.exe")
driver.get('https://stackoverflow.com')
Execute the program on which Firefox Quantum Browser will be initiated and the url https://stackoverflow.com will be accessed.
Python Download Location (Windows) :
Python (for Windows) can be download from the following location :
https://www.python.org/downloads/
I'm on VS Code in Windows 10, and here's how I solved it.
You need to pay attention to where the Python is located (in my case),
1) C:\Users\_Me_\AppData\Local\Programs\Python\Python38\
and where the Python looks for libraries/packages, including the ones installed using pip (again, in my case),
2) C:\Users\_Me_\AppData\Roaming\Python\Python38\
I don't know why these two locations are different (gotta fix it at some point). It seemed that Python was running from the first location, but it was looking for libraries in the second!:/
Anyway, since I have limited experience in Python , I just copied the \Lib\site-packages from the first location (including selenium folders) to \site-packages in second one in hopes of solving the issue, which worked out for me!
How to check for there locations
1) Open Python CLI, typed the following command:
which python
2) Open Python CLI, typed the following commands (From this answer):
>>> import site
>>> site.USER_SITE
EDIT
Since this seems a temporary solution, I uninstalled Python and reinstalled it again in a proper directory (other than the default install directory), and now which python and which pip point to the same folder! Problem solved!
If these solutions did not work for you, try looking into which Python interpreter your IDE is using (in my case I was using VSCode - you can find the interpreter in the bottom bar). Worked for me.
Easiest way is to copy all files of "venv" Lib, Scripts, Selenium and other folder into your main project folder.
This issue occur as pycharm directly take from virtual environment venv.
Hope this will resolve your problem :)

Error message while trying to install Tensorflow for GPU using Anaconda

I am trying to install Tensorflow for GPU using Anaconda on my Windows 10 system. Running
conda create --name tf_gpu tensorflow-gpu
I get:
Downloading and Extracting Packages
tensorflow-base-1.12 | 180.8 MB | #########################################################1 | 75%
[Errno 2] No such file or directory: 'C:\\Users\\miroslaw.bartkowiak\\AppData\\Local\\Continuum\\anaconda3\\pkgs\\tensorflow-base-1.12.0-gpu_py36h6e53903_0\\Lib\\site-packages\\tensorflow\\include\\tensorflow\\include\\external\\eigen_archive\\unsupported\\Eigen\\src\\SpecialFunctions\\arch\\CUDA\\CudaSpecialFunctions.h'
I'd appreciate your help ...
I believe your problem is Windows long path name support.
For some reason MS leave it off.
For Windows 10 Pro or above, run the Local Group Policy Editor (gpedit).
Go to Computer Configuration -> Administrative Templates -> System -> Filesystem.
Change the Enable Win32 long paths setting to Enabled and reboot.
For Windows 10 Home, you have to change the registry.
Hive: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
Set LongPathsEnabled to 1
Reboot.
Then try again.
Good luck!

SSL error while using pip install to install tensorflow-gpu

I am trying to install tensorflow-gpu by running pip install tensorflow-gpu Windows, inside an Anaconda enviornment, but I am getting the following error:
Could not install packages due to an EnvironmentError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1977)
I also tried doing it in a command prompt with administrator access, but it still didn't work.
C:\WINDOWS\system32>pip install tensorflow-gpu
Collecting tensorflow-gpu
Downloading https://files.pythonhosted.org/packages/2f/84/b6dfafe3282101f7d3a9410652ab4e6dc73f981fd63a40be0b47ff3bac3a/tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl (103.3MB)
19% |###### | 19.9MB 2.6MB/s eta 0:00:32
Could not install packages due to an EnvironmentError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:1977)
All other network-related activities(such as browsing the web) work properly on the computer. I also have the correct CUDA and cuDNN installed, along with the latest NVIDIA drivers.
I fixed this problem by purging my Anaconda installation and reinstalling it, and then installing tensorflow-gpu. However, I am still curious as to why this error even happened in the first place.
It's related to network connection. I faced the same error in my Ubuntu system. Hence solved it by changing my network(WiFi) connection.
Use the following syntax while installation packages:
pip install --user packagename
I had the same problem with PyCharm to install tensorflow. As Dimitri Bolt described, I started the CMD as administrator and used the sytax described by Devendra Kanade. I got the error again, but each time I started the command, the progress became bigger. After three or four times, the download was successful and I was able to import tensorflow in PyCharm.
You should note "Downloading" (19%, not finished yet) in the pip-msg just before the error. For pip, this means 99% that this is a download error.
The quick fix is to increase <retries> in the pip option :
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
NB: I've never tried this.
The general fix using normal download (I tried this to install PyQt5) :
a) Find the name of the problematic web-file in your pip-errmsg, enclosed in quotes, then google the whole (including quotes). In your case, that will be "tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl" .
b) Choose a reliable site and download that file. Windows 10 may give you erroneous msg about some .part-file but just ignore that msg and download again.
c) Load your browser list for downloaded files. For Firefox, ctrl-J will load that list (library). If failure, click to repeat download on the list (not site). You may need to repeat the clicking 10 times for the download to be successful !!!
d) Suppose that "tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl" is now in the local folder c:\Users\uuuu\Downloads\ .
Create in this folder an ansi-text file named "example-requirements.txt" which has 3 lines(2 empty lines) as below:
tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl
e) Now in a normal command prompt, issue 3 commands as below:
c:
cd c:\Users\uuuu\Downloads\
pip install --requirement example-requirements.txt --no-cache-dir
NB: you can copy and paste, very easy in Win 10.
f) If successful, done now !
g) If you again have pip-problem with downloading another web-file then you must repeat a) , b) , c) , d) and edit the old "example-requirements.txt" to contain 4 lines(2 empty lines) as below:
tensorflow_gpu-1.9.0-cp35-cp35m-win_amd64.whl
another-file-name-with-extension
h) Repeat e) , f) , g) ... ...
NB: DOC for pip install-options are found on https://pip.pypa.io/en/stable/cli/pip_install/#
(search for "Example Requirements File" on the page).
stumbled upon the same error while installing via conda, updating conda solved the problem (btw, the new version downloaded the packages sequentially, whilst the older attempted a parallel download)
Reinstall the library again!
I face this problem for several libraries like tensorflow-gpu and matplotlib
I have no idea why but if i found something i will share.