Setting up the project

If you haven't already cloned the repository with the complete code for all chapters, clone the repository now. The downloaded code has a directory called Chapter07, which contains the entire code for this chapter. Execute the following commands to set up the project:

  1. Start by navigating to the parent directory as follows:
cd Generative-Adversarial-Networks-Projects
  1. Now, change the directory from the current directory to Chapter07, as shown in the following example:
cd Chapter07
  1. Next, create a Python virtual environment for this project, as shown in the following code: 
virtualenv venv
virtualenv venv -p python3 # Create a virtual environment using
python3 interpreter
virtualenv venv -p python2 # Create a virtual environment using
python2 interpreter

We will be using this newly created virtual environment for this project. Each chapter has its own separate virtual environment.

  1. Activate the newly created virtual environment, as shown in the following code:
source venv/bin/activate

After you have activated the virtual environment, all further commands will be executed in this virtual environment.

  1. Install all libraries given in the requirements.txt file by executing the following command:
pip install -r requirements.txt

You can refer to the README.md file for further instructions on how to set up the project. Very often, developers face the problem of mismatching dependencies. Creating a separate virtual environment for each project will take care of this problem.

In this section, we have successfully set up the project and installed the requisite dependencies. In the next section, we'll work on the dataset.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.164.75