The development environment for DCGAN

There are three critical components to the Dockerfile that inherit our base_image. In the docker folder in the DCGAN directory, create a Dockerfile and complete the following steps: 

  1. Import the base_image we've been using for each of our chapters using the following command:
FROM base_image
  1. As we are using the LSUN dataset, we are going to use the LSUN repository to download the raw data, as follows:
RUN git clone https://github.com/fyu/lsun.git
  1. There are a few miscellaneous installations that end up being useful for debugging (IPython) and visualization (pydot and graphviz), which can be run with the following commands:
RUN apt install -y python3-pydot python-pydot-ng graphviz
RUN pip3 install ipython
  1. Now, to build the Dockerfile, we need to create a build script (aptly called build.sh in DCGAN and docker), as follows:
#/bin/bash
nvidia-docker build -t ch4 .
  1. Next, implement a clean script to remove the image from your machine if necessary (this is stored in a file called clean.sh in DCGAN and docker) with the following code:
#/bin/bash
docker rmi ch4
  1. As with all shell scripts, ensure that each of them is executable prior to using them. You can do this with the following command:
chmod 777 <filename>.sh
# Replace filename with the name of the file you want to grant
executable privileges to

  1. Your directory structure should now look like the following:
DCGAN
├── data
│ └── README.md
├── docker
│ ├── build.sh
│ ├── clean.sh
│ └── Dockerfile
  1. Now, we have a Dockerfile and a build script, build the Docker image by issuing the following command:
sudo ./build.sh

Now, it's time to move on and download some data!

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

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