Giter Site home page Giter Site logo

tylerlima / dcgan-oreilly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dmonn/dcgan-oreilly

0.0 2.0 0.0 1.49 MB

Notebook for O'Reilly's "Deep Convolutional Generative Adversarial Networks"

Home Page: https://www.oreilly.com/ideas/deep-convolutional-generative-adversarial-networks-with-tensorflow

Jupyter Notebook 99.62% Python 0.38%

dcgan-oreilly's Introduction

Deep Convolutional Generative Adversarial Networks with TensorFlow

In this tutorial, we will try to build a GAN that is able to generate human faces with TensorFlow. Sounds scary, doesn’t it?

This repository contains source code corresponding to our article "Deep Convolutional Generative Adversarial Networks with TensorFlow".

Setup

Download via Git

  1. Go to your home directory by opening your terminal and entering cd ~

  2. Clone the repository by entering

    git clone https://github.com/dmonn/dcgan-oreilly.git
    

Option 1: Dockerfiles (Recommended)

  1. After cloning the repo to your machine, enter

    docker build -t dcgan_<image_type> -f ./dockerfiles/Dockerfile.<image_type> ./dockerfiles/
    

    where <image_type> is either gpu or cpu. (Note that, in order to run these files on your GPU, you'll need to have a compatible GPU, with drivers installed and configured properly as described in TensorFlow's documentation.)

  2. Run the Docker image by entering

    docker run -it -p 8888:8888 -v <path to repo>:/root dcgan_<image_type>
    

    where <image_type> is either gpu or cpu, depending on the image you built in the last step.

  3. After building, starting, and attaching to the appropriate Docker container, run the provided Jupyter notebooks by entering

    jupyter notebook --ip 0.0.0.0
    

    and navigate to http://0.0.0.0:8888 in your browser.

  4. Choose DCGANs with Tensorflow.ipynb to open the Notebook.

Debugging docker

If you receive an error of the form:

WARNING: Error loading config file:/home/rp/.docker/config.json - stat /home/rp/.docker/config.json: permission denied
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.26/images/json: dial unix /var/run/docker.sock: connect: permission denied

It's most likely because you installed Docker using sudo permissions with a packet manager such as brew or apt-get. To solve this permission denied simply run docker with sudo (ie. run docker commands with sudo docker <command and options> instead of just docker <command and options>).

Option 2: Local setup using Miniconda

If you don't have or don't want to use Docker, you can follow these steps to setup the notebook.

  1. Install miniconda using one of the installers and the miniconda installation instructions. Use Python3.6.

  2. After the installation, create a new virtual environment, using this command.

    $ conda create -n dcgan
    $ source activate venv
    
  3. You are now in a virtual environment. Next up, install TensorFlow by following the instructions.

  4. To install the rest of the dependenies, navigate into your repository and run

    $ pip install -r dockerfiles/requirements.txt
    
  5. Now you can run

    jupyter notebook
    

    to finally start up the notebook. A browser should open automatically. If not, navigate to http://127.0.0.1:8888 in your browser.

  6. Choose DCGANs with Tensorflow.ipynb to open the Notebook.

Requirements

A helper function will download the CelebA dataset to your machine. This will need up to 3GB of disk space!

dcgan-oreilly's People

Contributors

dmonn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.