Info-icon.png We have moved to https://openmodeldb.info/. This new site has a tag and search system, which will make finding the right models for you much easier! If you have any questions, ask here: https://discord.gg/cpAUpDK

Difference between revisions of "ESRGAN Installation Guide for Windows"

From Upscale Wiki
Jump to navigation Jump to search
(Updated PyTorch)
m (Changed a few Python 3.8 references)
(16 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
| Also make sure that you have no existing Python installation(s) if you want to follow this guide (especially older Python versions)
 
| Also make sure that you have no existing Python installation(s) if you want to follow this guide (especially older Python versions)
 
|-
 
|-
| Only Python 3.7.x is currently supported. Also only the Python installation as instructed below is supported.  
+
| Only Python 3.9.x is currently supported. Also only the Python installation as instructed below is supported.  
 
|-
 
|-
 
| No knowledge of Python or coding is necessary to follow this guide.
 
| No knowledge of Python or coding is necessary to follow this guide.
 
|-
 
|-
| [https://discord.gg/SxvYsgE Support is here if you have problems.] Make sure that you followed the instructions to the letter.
+
| [https://discord.gg/cpAUpDK Support is here if you have problems.] Make sure that you followed the instructions to the letter.
 +
|-
 +
|There was an issue with older versions of Windows 10 and the current version of NumPy, if you haven't updated your PC recently, downgrade NumPy like this:
 +
<code>
 +
pip install numpy==1.19.3
 +
</code>
 
|}
 
|}
  
Line 20: Line 25:
 
=== Text / Picture Guide ===
 
=== Text / Picture Guide ===
  
# Get the latest stable 64-bit Python 3.7.x release here: [https://www.python.org/downloads/windows/ Python Download]. At the time of writing this is Python 3.7.5. '''Python 3.8 is NOT supported currently.'''
+
==== Installing Python 3.9====
 +
 
 +
# Get the latest stable 64-bit Python 3.9.x release here: [https://www.python.org/downloads/windows/ Python Download]. At the time of writing this is Python 3.9.2.
 
#: [[File:GuideEsrganWin_1-python-link.jpg|frameless|A snapshot of the "Python Releases for Windows" section of the above linked webpage as of August 12, 2019. The "Download Windows x86-64 executable installer" link is highlighted.]]
 
#: [[File:GuideEsrganWin_1-python-link.jpg|frameless|A snapshot of the "Python Releases for Windows" section of the above linked webpage as of August 12, 2019. The "Download Windows x86-64 executable installer" link is highlighted.]]
 
# Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation.  
 
# Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation.  
Line 28: Line 35:
 
# Mirror my selections and click on install (Make sure that the install location contains no spaces).  
 
# Mirror my selections and click on install (Make sure that the install location contains no spaces).  
 
#: [[File:GuideEsrganWin_4-installer-3.jpg|frameless|The Advanced Options screen from the Python installer. All options are checked except "Download debug binaries". Install location is set as "C:\Python37". The checked boxes and the install location are highlighted.]]
 
#: [[File:GuideEsrganWin_4-installer-3.jpg|frameless|The Advanced Options screen from the Python installer. All options are checked except "Download debug binaries". Install location is set as "C:\Python37". The checked boxes and the install location are highlighted.]]
# You have now successfully installed Python 3. Click on Close now.
+
 
# Press <Windows/Super key> + R. Enter <code>cmd</code> and click on <code>OK</code>
+
==== Installing git (+ Bash) ====
#: [[File:GuideEsrganWin_6-run.jpg|frameless|A picture of the Windows Run prompt open with "cmd" in the "Open:" field. "cmd" and the OK button are highlighted.]]
+
 
# We will now install Pytorch:
+
# Get the latest stable 64-bit Git release here: [https://git-scm.com/download/win Git Download].
#* If you have a '''Nvidia''' graphic card enter the following command in the cmd and press enter:  
+
# Run the installer and select the options as you want, the defaults are fine. I recommend to check the Launch Git Bash Explorer Integration. Also set your default editor to whatever editor is used (Unless you use the git command to commit, this setting is irrelevant for you).
#*: <code>pip install torch===1.3.1 torchvision===0.4.2 -f https://download.pytorch.org/whl/torch_stable.html</code>
+
 
#*: [[File:GuideEsrganWin_7-Nvidia.jpg|frameless|A Windows command prompt open with the command entered but not executed.]]
+
==== Installing Python Modules required by ESRGAN ====
#* If you have an '''AMD / Intel''' graphic card enter the following command in the cmd and press enter:
+
 
#*: <code>pip install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html</code>  
+
# Launch a Git Bash Shell as an administrator (right-click it in the start menu to get that option).
#*: [[File:GuideEsrganWin_7-CPU.jpg|frameless|A Windows command prompt open with the command entered but not executed.]]
+
#* If you have '''a Nvidia GPU'' copy the following command and paste it in Git Bash and press enter:  
#* If the command won’t work for you, please report it. In the meantime, you can get an up to date version here at the [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
+
#*: <code>pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code>
# Now we install the other requirements for running and training ESRGAN and SFTGAN. Enter:
+
#* If you have '''no Nvidia GPU''' copy the following command and paste it in Git Bash and press enter:  
 +
#*: <code>pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html</code>  
 +
#* If the command won’t work for you, please report it. In the meantime, you can get an up to date version on the [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
 +
# Now we install the other requirements for running and training ESRGAN and SFTGAN. Paste and press enter:
 
#: <code>pip install opencv-python</code>
 
#: <code>pip install opencv-python</code>
#: [[File:GuideEsrganWin_8-pip.jpg|frameless|A Windows command prompt open with the above command entered but not executed.]]
+
 
# Choose a folder where you want to install ESRGAN. Because of the maximum path length limitation in windows, I recommend something as short as possible like: <code>C:\ctp\esrgan\</code></p>
+
==== Cloning ESRGAN into a folder of your choice ====
## Create a folder called <code>ctp</code> (That will come in handy if you want to install Deorders scripts later)
+
 
## In the <code>ctp</code> folder create a folder called <code>esrgan</code>
+
# Choose a folder where you want to install ESRGAN. Because of the maximum path length limitation in windows, I recommend something as short as possible like: <code>C:\nn\esrgan\</code></p>
## Open the <code>esrgan</code> folder.
+
## Create a folder called <code>nn</code> (Try to avoid spaces and always use short paths especially on Windows on other operating systems the path length at least is irrelevant)
# Now it is time to download ESRGAN:
+
## In the <code>nn</code> folder right click and select <code>Git Bash Here</code>.
## Go to [https://github.com/BlueAmulet/ESRGAN the ESRGAN GitHub Repo (fork from BlueAmulet)]
+
# Clone ESRGAN by pasting the following command
## Click on <code>Clone or Download</code>
+
#: <code>git clone https://github.com/JoeyBallentine/ESRGAN.git</code>
## Click on <code>Download ZIP</code>
 
##: [[File:GuideEsrganWin_10-github.jpg|frameless|An image of the ESRGAN repo on Github, with the "Clone or download" dropdown button highlighted as well as the "Download ZIP" link]]
 
# Extract the contents of the folder into your <code>C:\ctp\esrgan</code> folder you created in step 10. It should already be open and look like the image below:
 
#: [[File:GuideEsrganWin_11-explorer.jpg|frameless|An image of C:/ctp/esrgan/ open in Windows Explorer with the address bar underlined]]
 
# Now it is time to get some ESRGAN models from our [https://upscale.wiki/wiki/Model_Database Model Database].
 
## Download a model of your choice. The default ESRGAN model is under the pretrained model section.
 
## Put the model(s) (<code>.pth</code> files) that you have just downloaded into your <code>models</code> folder in your <code>esrgan</code> folder
 
### For example in:
 
###: <code>C:\ctp\esrgan\models\</code>
 
  
 
=== Video Guide ===
 
=== Video Guide ===

Revision as of 12:43, 31 March 2021

Please make sure that you have the latest driver version if you use a Nvidia GPU. Both the Studio and CUDA drivers are recommended. The CUDA driver on only gets updated when CUDA itself gets updated, but will be compatible with the CUDA version.
Also make sure that you have no existing Python installation(s) if you want to follow this guide (especially older Python versions)
Only Python 3.9.x is currently supported. Also only the Python installation as instructed below is supported.
No knowledge of Python or coding is necessary to follow this guide.
Support is here if you have problems. Make sure that you followed the instructions to the letter.
There was an issue with older versions of Windows 10 and the current version of NumPy, if you haven't updated your PC recently, downgrade NumPy like this:

pip install numpy==1.19.3

This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.

Our goal is to open up A.I. upscaling to everyone, not just to those who can pay lots of money or are good at coding.

Installing ESRGAN

Text / Picture Guide

Installing Python 3.9

  1. Get the latest stable 64-bit Python 3.9.x release here: Python Download. At the time of writing this is Python 3.9.2.
    A snapshot of the "Python Releases for Windows" section of the above linked webpage as of August 12, 2019. The "Download Windows x86-64 executable installer" link is highlighted.
  2. Run the installer and make sure that Add Python 3.*x* to Path and Install launcher for all users (recommended) is selected, then click on Customize installation.
    The "Install Python" screen from the python installer. All checkboxes are checked. The checkboxes and the "Customize installation" button are highlighted.
  3. Make sure that every Option is selected and click on next.
    The Optional Features screen from the Python installer. All options are checked. The checked boxes are highlighted.
  4. Mirror my selections and click on install (Make sure that the install location contains no spaces).
    The Advanced Options screen from the Python installer. All options are checked except "Download debug binaries". Install location is set as "C:\Python37". The checked boxes and the install location are highlighted.

Installing git (+ Bash)

  1. Get the latest stable 64-bit Git release here: Git Download.
  2. Run the installer and select the options as you want, the defaults are fine. I recommend to check the Launch Git Bash Explorer Integration. Also set your default editor to whatever editor is used (Unless you use the git command to commit, this setting is irrelevant for you).

Installing Python Modules required by ESRGAN

  1. Launch a Git Bash Shell as an administrator (right-click it in the start menu to get that option).
    • If you have 'a Nvidia GPU copy the following command and paste it in Git Bash and press enter:
      pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
    • If you have no Nvidia GPU copy the following command and paste it in Git Bash and press enter:
      pip install torch==1.8.1+cpu torchvision==0.9.1+cpu torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
    • If the command won’t work for you, please report it. In the meantime, you can get an up to date version on the Pytorch Website. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
  2. Now we install the other requirements for running and training ESRGAN and SFTGAN. Paste and press enter:
    pip install opencv-python

Cloning ESRGAN into a folder of your choice

  1. Choose a folder where you want to install ESRGAN. Because of the maximum path length limitation in windows, I recommend something as short as possible like: C:\nn\esrgan\

    1. Create a folder called nn (Try to avoid spaces and always use short paths especially on Windows on other operating systems the path length at least is irrelevant)
    2. In the nn folder right click and select Git Bash Here.
  2. Clone ESRGAN by pasting the following command
    git clone https://github.com/JoeyBallentine/ESRGAN.git

Video Guide

Princess Potato recorded the process of installing ESRGAN and IEU in a video for all of you to enjoy. Seeing someone do it and talk about the process might help a lot of people to install not just ESRGAN, but also IEU You will find the video on YouTube here by clicking on this link.

Usage

How to actually use ESRGAN (IEU for example), other useful information and important links are here.