Error message while trying to install Tensorflow for GPU using Anaconda - tensorflow

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!

Related

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

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?.

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.

How to install Anaconda as a portable installation on a USB

I've looked everywhere for a beginner-friendly guide on how to install Anaconda on a USB locally, but to no avail.
I'm currently using WinPython as an alternative, however, I get many errors when using Tkinter for my projects. I tried to see if it would give me an error after importing turtle and running basic code, but it returns AttributeError: module 'turtle' has no attribute 'Turtle' when it would otherwise work on my desktop.
Explanation:
You might be having two conda installed(not env, but the conda navigator) in your machine
The default path to conda will be the on the C: drive of your computer
When you create a env, it will then dowload automaticly on your C: not on your new downloaded anaconda
You can't activate the new env with it's name, the machine will name the env to "base", which is the same to your other default env in your original machine. It will crash and left your env with no name.
Solve:
You can activate the env with not only the name, the other way is activate with the path
conda activate pathofenv
More detail
Install anaconda on the usb stick
-remember to set the installation location to the stick
-The installation takes a amazing long time(for me 30min)
After instalation has finished, open cmd
Finally to activate the env You just need to type conda activate thepathofenv
This worked for me and hope it;ll work for you too :)
.sorry for typo

distro 'rhel7.2' does not exist in our dictionary

While installing a kvm via virt-install I have used following attribute os_variant=rhel7.2. While installing I am getting following error :
distro 'rhel7.2' does not exist in our dictionary
When I do uname -r I am getting output as
3.10.0-327.el7.x86_64
It is a RHEL KVM host.
Running osinfo-query os|grep 'Red Hat Enterprise Linux 7.2' returns following:
rhel7.1 | Red Hat Enterprise Linux 7.2 | 7.2 | http://redhat.com/rhel/7.2
What can be solution to this problem?
You could create a custom config file to define a RHEL-7.2 distro, but it is honestly not that important from virt-install's POV. The distro is used to lookup the optimized drivers to use for disk & network primarily. Just using the 'rhel7.1' distro type when installing 'rhel-7.2' will work just fine from this POV.
virt-install get's it's os information out of osinfo-db
If your os does not ship a recent version of osinfo-db you can manually download it from https://releases.pagure.org/libosinfo/ and import it.
e.g.
wget https://releases.pagure.org/libosinfo/osinfo-db-20200325.tar.xz
osinfo-db-import -v osinfo-db-20200325.tar.xz
-v will display all imported os'es, I believe your choice has to match one of the xml files in this list.

How to install Windows 10 Core on Raspberry Pi 2 without a real (physical) machine

I only have a Windows 8.1 x64 PC and a Raspberry Pi 2. I have some problems that prevent me from installing Windows 10 on my PC.
In this situation, is there any way to install "Windows 10 IoT Core" to the SD card on Raspberry Pi2?
I tried the following:
Using a virtual machine - Windows 10 x64 Preview on VM Player, but it failed. I used:
dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck -> Error 87? I forgot the number
I only copied "dism.exe" file from "window10x64 .iso" file in sources folder.
and tried the following, but failed:
dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck -> Error 87? same
I only copied "dism.exe" file from "window10x86 .iso" file in sources folder.
and tried the following, but failed:
dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck -> Error 87? same
So now I know that the "dism.exe" that i called is only for Windows 8, not for Windows 10.
If the ".ffu" installer exists, it is not problem anymore, but it doesn't exist.
I just did this earlier today with mine and it works. From the iso, without your VM, mount it as a virtual Cd drive (you can use MagicISO Virtual CD/DVD Manager) Then open the CD, and run the .msi.
Install python and download ffu2img.py3 (You may have to copy and paste it into notepad) to C:\Program Files (x86)\Microsoft IoT\FFU\RaspberryPi2.
Now open a cmd window as an administrator and type,
cd C:\Program Files (x86)\Microsoft IoT\FFU\RaspberryPi2\
C:\Python34\python.exe ffu2img.py flash.ffu
Then you have the img file you can write to the sd card just like raspbian. =)
Edit: If you already have the ffu file, skip the first section.