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
Line 1: Line 1:
 +
{| class="wikitable"
 +
|-
 +
| Please make sure that you have the latest driver if you use an Nvidia GPU
 +
|-
 +
| Also make sure that you have no existing Python installations if you want to follow this guide (especially older Python versions)
 +
|}
 +
 
This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.
 
This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.
  

Revision as of 21:14, 18 August 2019

Please make sure that you have the latest driver if you use an Nvidia GPU
Also make sure that you have no existing Python installations if you want to follow this guide (especially older Python versions)

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

No knowledge of Python or coding is necessary to follow this guide.

If you have any problems during or after the installation, feel free to ask any questions on our Discord server and we will try to help you out.

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.

Before you start, make sure that your display driver is up-to-date. if you have an Nvidia GPU, to make sure it supports the newest CUDA version; if you want to be on the safe side, use the latest CUDA driver.

Installing ESRGAN

  1. Get the latest stable 64-bit Python 3 release here: Python Download
    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.
  5. You have now successfully installed Python 3. Click on Close now.
  6. Press <Windows/Super key> + R. Enter cmd and click on OK
    A picture of the Windows Run prompt open with "cmd" in the "Open:" field. "cmd" and the OK button are highlighted.
  7. We will now install Pytorch:
    • If you have a Nvidia graphic card enter the following command in the cmd and press enter:
      pip install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
      A Windows command prompt open with the command entered but not executed.
    • If you have an AMD / Intel graphic card enter the following command in the cmd and press enter:
      pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
      A Windows command prompt open with the command entered but not executed.
    • 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 Pytorch Website. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
  8. Now we install the other requirements for running and training ESRGAN and SFTGAN. Enter:
    pip install opencv-python
    A Windows command prompt open with the above command entered but not executed.
  9. 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:\ctp\esrgan\

    1. Create a folder called ctp (That will come in handy if you want to install Deorders scripts later)
    2. In the ctp folder create a folder called esrgan
    3. Open the esrgan folder.
  10. Now it is time to download ESRGAN:
    1. Go to the ESRGAN GitHub Repo (old model structure)
    2. Click on Clone or Download
    3. Click on Download ZIP
      An image of the ESRGAN repo on Github, with the "Clone or download" dropdown button highlighted as well as the "Download ZIP" link
  11. Extract the contents of the folder into your C:\ctp\esrgan folder you created in step 10. It should already be open and look like the image below:
    An image of C:/ctp/esrgan/ open in Windows Explorer with the address bar underlined
  12. Now it is time to download and install the default ESRGAN models:
    1. Go to the ESRGAN Pretrained Models Google Drive
    2. Download the two _old_arch.pth files.
    3. Put the two .pth files that you have just downloaded into your models folder in your esrgan folder
      1. For example in:
        C:\ctp\esrgan\models\
  13. If you have a Nvidia Graphic Card, then you have successfully installed ESRGAN, congratulations!
  14. However, if you have an AMD / Intel Graphic Card, then you need to open test.py in your ESRGAN folder with a text editor.
    1. Change:
      device = torch.device('cuda') # if you want to run on CPU, change 'cuda' -> cpu
      into:
      device = torch.device('cpu') # if you want to run on CPU, change 'cuda' -> cpu