master
/ coding_here.ipynb

coding_here.ipynb @master

a606ce8
 
 
 
f5eee81
a606ce8
f5eee81
a606ce8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5eee81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a606ce8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print('Hello Mo!')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[33mWARNING: The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\u001b[0m\n",
      "\u001b[33mWARNING: The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\u001b[0m\n",
      "Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple\n",
      "Collecting dominate\n",
      "\u001b[33m  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError(\"HTTPSConnectionPool(host='mirrors.ustc.edu.cn', port=443): Read timed out. (read timeout=15)\",)': /pypi/web/simple/dominate/\u001b[0m\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1d/64/593e829416c951eb35c2246430d59b86f640087e29e71f32632bcde5d0f7/dominate-2.4.0-py2.py3-none-any.whl\n",
      "Installing collected packages: dominate\n",
      "Successfully installed dominate-2.4.0\n"
     ]
    }
   ],
   "source": [
    "!pip install dominate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[33mWARNING: The directory '/home/jovyan/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\u001b[0m\n",
      "\u001b[33mWARNING: The directory '/home/jovyan/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.\u001b[0m\n",
      "Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple\n",
      "Collecting visdom\n",
      "\u001b[?25l  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/97/c4/5f5356fd57ae3c269e0e31601ea6487e0622fedc6756a591e4a5fd66cc7a/visdom-0.1.8.8.tar.gz (1.4MB)\n",
      "\u001b[K     |████████████████████████████████| 1.4MB 1.6MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: numpy>=1.8 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.16.0)\n",
      "Requirement already satisfied: scipy in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.3.1)\n",
      "Requirement already satisfied: requests in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (2.22.0)\n",
      "Requirement already satisfied: tornado in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (6.0.3)\n",
      "Requirement already satisfied: pyzmq in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (18.1.0)\n",
      "Requirement already satisfied: six in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.12.0)\n",
      "Collecting torchfile (from visdom)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/91/af/5b305f86f2d218091af657ddb53f984ecbd9518ca9fe8ef4103a007252c9/torchfile-0.1.0.tar.gz\n",
      "Collecting websocket-client (from visdom)\n",
      "\u001b[?25l  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/29/19/44753eab1fdb50770ac69605527e8859468f3c0fd7dc5a76dd9c4dbd7906/websocket_client-0.56.0-py2.py3-none-any.whl (200kB)\n",
      "\u001b[K     |████████████████████████████████| 204kB 50.1MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: pillow in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (6.1.0)\n",
      "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (1.25.3)\n",
      "Requirement already satisfied: idna<2.9,>=2.5 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (2.8)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (2019.6.16)\n",
      "Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (3.0.4)\n",
      "Building wheels for collected packages: visdom, torchfile\n",
      "\u001b[33m  WARNING: Building wheel for visdom failed: [Errno 13] Permission denied: '/home/jovyan/.cache/pip/wheels/65'\u001b[0m\n",
      "\u001b[33m  WARNING: Building wheel for torchfile failed: [Errno 13] Permission denied: '/home/jovyan/.cache/pip/wheels/b7'\u001b[0m\n",
      "Failed to build visdom torchfile\n",
      "Installing collected packages: torchfile, websocket-client, visdom\n",
      "  Running setup.py install for torchfile ... \u001b[?25ldone\n",
      "\u001b[?25h  Running setup.py install for visdom ... \u001b[?25ldone\n",
      "\u001b[?25hSuccessfully installed torchfile-0.1.0 visdom-0.1.8.8 websocket-client-0.56.0\n"
     ]
    }
   ],
   "source": [
    "!pip install visdom"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking for scripts.\n",
      "It's Alive!\n",
      "INFO:root:Application Started\n",
      "You can navigate to http://jupyter-4f4549ll415a47504b0lu4dc49ss44042a4ftm5f47h48h92da34a0x:8097\n"
     ]
    }
   ],
   "source": [
    "!python -m visdom.server"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/home/jovyan/work'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking for scripts.\n",
      "It's Alive!\n",
      "INFO:root:Application Started\n",
      "You can navigate to http://jupyter-4f4549ll415a47504b0lu4dc49ss44042a4ftm5f47h48h92da34a0x:8097\n"
     ]
    }
   ],
   "source": [
    "!python -m visdom.server"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note: available models are apple2orange, orange2apple, summer2winter_yosemite, winter2summer_yosemite, horse2zebra, zebra2horse, monet2photo, style_monet, style_cezanne, style_ukiyoe, style_vangogh, sat2map, map2sat, cityscapes_photo2label, cityscapes_label2photo, facades_photo2label, facades_label2photo, iphone2dslr_flower\n",
      "Specified [horse2zebra]\n",
      "WARNING: timestamping does nothing in combination with -O. See the manual\n",
      "for details.\n",
      "\n",
      "--2019-09-27 17:08:47--  http://efrosgans.eecs.berkeley.edu/cyclegan/pretrained_models/horse2zebra.pth\n",
      "Resolving efrosgans.eecs.berkeley.edu (efrosgans.eecs.berkeley.edu)... 128.32.189.73\n",
      "Connecting to efrosgans.eecs.berkeley.edu (efrosgans.eecs.berkeley.edu)|128.32.189.73|:80... connected.\n",
      "HTTP request sent, awaiting response... 200 OK\n",
      "Length: 45575747 (43M)\n",
      "Saving to: ‘./checkpoints/horse2zebra_pretrained/latest_net_G.pth’\n",
      "\n",
      "./checkpoints/horse 100%[===================>]  43.46M  73.2KB/s    in 5m 31s  \n",
      "\n",
      "2019-09-27 17:14:25 (135 KB/s) - ‘./checkpoints/horse2zebra_pretrained/latest_net_G.pth’ saved [45575747/45575747]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "!bash ./scripts/download_cyclegan_model.sh horse2zebra"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Specified [horse2zebra]\n",
      "WARNING: timestamping does nothing in combination with -O. See the manual\n",
      "for details.\n",
      "\n",
      "--2019-09-27 17:17:21--  https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/horse2zebra.zip\n",
      "Resolving people.eecs.berkeley.edu (people.eecs.berkeley.edu)... 128.32.189.73\n",
      "Connecting to people.eecs.berkeley.edu (people.eecs.berkeley.edu)|128.32.189.73|:443... connected.\n",
      "HTTP request sent, awaiting response... 200 OK\n",
      "Length: 116867962 (111M) [application/zip]\n",
      "Saving to: ‘./datasets/horse2zebra.zip’\n",
      "\n",
      "2zebra.zip           69%[============>       ]  76.95M   191KB/s    eta 3m 17s "
     ]
    }
   ],
   "source": [
    "!bash ./datasets/download_cyclegan_dataset.sh horse2zebra"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "----------------- Options ---------------\n",
      "             aspect_ratio: 1.0                           \n",
      "               batch_size: 1                             \n",
      "          checkpoints_dir: ./checkpoints                 \n",
      "                crop_size: 256                           \n",
      "                 dataroot: datasets/horse2zebra/testA    \t[default: None]\n",
      "             dataset_mode: single                        \n",
      "                direction: AtoB                          \n",
      "          display_winsize: 256                           \n",
      "                    epoch: latest                        \n",
      "                     eval: False                         \n",
      "                  gpu_ids: 0                             \n",
      "                init_gain: 0.02                          \n",
      "                init_type: normal                        \n",
      "                 input_nc: 3                             \n",
      "                  isTrain: False                         \t[default: None]\n",
      "                load_iter: 0                             \t[default: 0]\n",
      "                load_size: 256                           \n",
      "         max_dataset_size: inf                           \n",
      "                    model: test                          \n",
      "             model_suffix:                               \n",
      "               n_layers_D: 3                             \n",
      "                     name: horse2zebra_pretrained        \t[default: experiment_name]\n",
      "                      ndf: 64                            \n",
      "                     netD: basic                         \n",
      "                     netG: resnet_9blocks                \n",
      "                      ngf: 64                            \n",
      "               no_dropout: True                          \t[default: False]\n",
      "                  no_flip: False                         \n",
      "                     norm: instance                      \n",
      "                    ntest: inf                           \n",
      "                 num_test: 50                            \n",
      "              num_threads: 4                             \n",
      "                output_nc: 3                             \n",
      "                    phase: test                          \n",
      "               preprocess: resize_and_crop               \n",
      "              results_dir: ./results/                    \n",
      "           serial_batches: False                         \n",
      "                   suffix:                               \n",
      "                  verbose: False                         \n",
      "----------------- End -------------------\n",
      "Traceback (most recent call last):\n",
      "  File \"test.py\", line 38, in <module>\n",
      "    opt = TestOptions().parse()  # get test options\n",
      "  File \"/home/jovyan/work/options/base_options.py\", line 133, in parse\n",
      "    torch.cuda.set_device(opt.gpu_ids[0])\n",
      "  File \"/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py\", line 281, in set_device\n",
      "    torch._C._cuda_setDevice(device)\n",
      "  File \"/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py\", line 178, in _lazy_init\n",
      "    _check_driver()\n",
      "  File \"/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py\", line 99, in _check_driver\n",
      "    http://www.nvidia.com/Download/index.aspx\"\"\")\n",
      "AssertionError: \n",
      "Found no NVIDIA driver on your system. Please check that you\n",
      "have an NVIDIA GPU and installed a driver from\n",
      "http://www.nvidia.com/Download/index.aspx\n"
     ]
    }
   ],
   "source": [
    "!python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}