Implementation: CycleGAN and Pix2pix

The implementation of CycleGAN and Pix2pix based on pytorch is published on github. Here’s a todo procedure with anaconda.

The CPU mode installation is under test right now…

  1. pytorch installation
    1. see the repository
    2. For a machine with GPU
      1. conda install -c conda-forge dominate
      2. conda install pytorch torchvision cuda80 -c soumith
    3. For a machine without GPU
      1. export enviroment variable NO_CUDA=1
      2. add anaconda root directory to CMAKE_PREFIX_PATH as
        export CMAKE_PREFIX_PATH=[anaconda root directory]
      3. conda install numpy pyyaml mkl setuptools cmake gcc cffi
      4. git clone https://github.com/pytorch/pytorch.git
      5. cd pytorch/
      6. python setup.py install
      7. cd ..
      8. git clone https://github.com/pytorch/vision.git
      9. cd vision
      10. python setup.py install
  2. CycleGAN and pix2pix installation
    1. conda install -c conda-forge dominate
    2. git clone https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
    3. cd pytorch-CycleGAN-and-pix2pix

Note that running train.py and test.py without GPU requires to disable GPU via command line such as –gpu_id -1. For instance:
– With GPU: python train.py –dataroot ./datasets/facades –name facades_pix2pix –gpu_ids 0 –model pix2pix –align_data –which_direction BtoA
– Without GPU: python train.py –dataroot ./datasets/facades –name facades_pix2pix –gpu_ids -1 –model pix2pix –align_data –which_direction BtoA

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s