master
/ coding_here.ipynb

coding_here.ipynb @masterview markup · raw · history · blame

Notebook
In [ ]:
print('Hello Mo!')
In [2]:
!pip install dominate
WARNING: 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.
WARNING: 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.
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting dominate
  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/
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/1d/64/593e829416c951eb35c2246430d59b86f640087e29e71f32632bcde5d0f7/dominate-2.4.0-py2.py3-none-any.whl
Installing collected packages: dominate
Successfully installed dominate-2.4.0
In [2]:
!pip install visdom
WARNING: 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.
WARNING: 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.
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting visdom
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/97/c4/5f5356fd57ae3c269e0e31601ea6487e0622fedc6756a591e4a5fd66cc7a/visdom-0.1.8.8.tar.gz (1.4MB)
     |████████████████████████████████| 1.4MB 1.6MB/s eta 0:00:01
Requirement already satisfied: numpy>=1.8 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.16.0)
Requirement already satisfied: scipy in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.3.1)
Requirement already satisfied: requests in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (2.22.0)
Requirement already satisfied: tornado in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (6.0.3)
Requirement already satisfied: pyzmq in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (18.1.0)
Requirement already satisfied: six in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (1.12.0)
Collecting torchfile (from visdom)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/91/af/5b305f86f2d218091af657ddb53f984ecbd9518ca9fe8ef4103a007252c9/torchfile-0.1.0.tar.gz
Collecting websocket-client (from visdom)
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/29/19/44753eab1fdb50770ac69605527e8859468f3c0fd7dc5a76dd9c4dbd7906/websocket_client-0.56.0-py2.py3-none-any.whl (200kB)
     |████████████████████████████████| 204kB 50.1MB/s eta 0:00:01
Requirement already satisfied: pillow in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from visdom) (6.1.0)
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)
Requirement already satisfied: idna<2.9,>=2.5 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages (from requests->visdom) (2019.6.16)
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)
Building wheels for collected packages: visdom, torchfile
  WARNING: Building wheel for visdom failed: [Errno 13] Permission denied: '/home/jovyan/.cache/pip/wheels/65'
  WARNING: Building wheel for torchfile failed: [Errno 13] Permission denied: '/home/jovyan/.cache/pip/wheels/b7'
Failed to build visdom torchfile
Installing collected packages: torchfile, websocket-client, visdom
  Running setup.py install for torchfile ... done
  Running setup.py install for visdom ... done
Successfully installed torchfile-0.1.0 visdom-0.1.8.8 websocket-client-0.56.0
In [ ]:
!python -m visdom.server
Checking for scripts.
It's Alive!
INFO:root:Application Started
You can navigate to http://jupyter-4f4549ll415a47504b0lu4dc49ss44042a4ftm5f47h48h92da34a0x:8097
In [2]:
pwd
Out[2]:
'/home/jovyan/work'
In [ ]:
!python -m visdom.server
Checking for scripts.
It's Alive!
INFO:root:Application Started
You can navigate to http://jupyter-4f4549ll415a47504b0lu4dc49ss44042a4ftm5f47h48h92da34a0x:8097
In [1]:
!bash ./scripts/download_cyclegan_model.sh horse2zebra
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
Specified [horse2zebra]
WARNING: timestamping does nothing in combination with -O. See the manual
for details.

--2019-09-27 17:08:47--  http://efrosgans.eecs.berkeley.edu/cyclegan/pretrained_models/horse2zebra.pth
Resolving efrosgans.eecs.berkeley.edu (efrosgans.eecs.berkeley.edu)... 128.32.189.73
Connecting to efrosgans.eecs.berkeley.edu (efrosgans.eecs.berkeley.edu)|128.32.189.73|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45575747 (43M)
Saving to: ‘./checkpoints/horse2zebra_pretrained/latest_net_G.pth’

./checkpoints/horse 100%[===================>]  43.46M  73.2KB/s    in 5m 31s  

2019-09-27 17:14:25 (135 KB/s) - ‘./checkpoints/horse2zebra_pretrained/latest_net_G.pth’ saved [45575747/45575747]

In [ ]:
!bash ./datasets/download_cyclegan_dataset.sh horse2zebra
Specified [horse2zebra]
WARNING: timestamping does nothing in combination with -O. See the manual
for details.

--2019-09-27 17:17:21--  https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/horse2zebra.zip
Resolving people.eecs.berkeley.edu (people.eecs.berkeley.edu)... 128.32.189.73
Connecting to people.eecs.berkeley.edu (people.eecs.berkeley.edu)|128.32.189.73|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 116867962 (111M) [application/zip]
Saving to: ‘./datasets/horse2zebra.zip’

2zebra.zip           69%[============>       ]  76.95M   191KB/s    eta 3m 17s 
In [1]:
!python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout
----------------- Options ---------------
             aspect_ratio: 1.0                           
               batch_size: 1                             
          checkpoints_dir: ./checkpoints                 
                crop_size: 256                           
                 dataroot: datasets/horse2zebra/testA    	[default: None]
             dataset_mode: single                        
                direction: AtoB                          
          display_winsize: 256                           
                    epoch: latest                        
                     eval: False                         
                  gpu_ids: 0                             
                init_gain: 0.02                          
                init_type: normal                        
                 input_nc: 3                             
                  isTrain: False                         	[default: None]
                load_iter: 0                             	[default: 0]
                load_size: 256                           
         max_dataset_size: inf                           
                    model: test                          
             model_suffix:                               
               n_layers_D: 3                             
                     name: horse2zebra_pretrained        	[default: experiment_name]
                      ndf: 64                            
                     netD: basic                         
                     netG: resnet_9blocks                
                      ngf: 64                            
               no_dropout: True                          	[default: False]
                  no_flip: False                         
                     norm: instance                      
                    ntest: inf                           
                 num_test: 50                            
              num_threads: 4                             
                output_nc: 3                             
                    phase: test                          
               preprocess: resize_and_crop               
              results_dir: ./results/                    
           serial_batches: False                         
                   suffix:                               
                  verbose: False                         
----------------- End -------------------
Traceback (most recent call last):
  File "test.py", line 38, in <module>
    opt = TestOptions().parse()  # get test options
  File "/home/jovyan/work/options/base_options.py", line 133, in parse
    torch.cuda.set_device(opt.gpu_ids[0])
  File "/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py", line 281, in set_device
    torch._C._cuda_setDevice(device)
  File "/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py", line 178, in _lazy_init
    _check_driver()
  File "/home/jovyan/.virtualenvs/basenv/lib/python3.5/site-packages/torch/cuda/__init__.py", line 99, in _check_driver
    http://www.nvidia.com/Download/index.aspx""")
AssertionError: 
Found no NVIDIA driver on your system. Please check that you
have an NVIDIA GPU and installed a driver from
http://www.nvidia.com/Download/index.aspx