GithubHelp home page GithubHelp logo

fastainn_setup's Introduction

Setup the VM for learning fast.ai (http://course.fast.ai/)

The install-gpu.sh in modified from https://github.com/fastai/courses.git

Step to install

  1. install vagrant (https://www.vagrantup.com) & virtualbox (https://www.virtualbox.org)
  2. download this repository: git clone https://github.com/pomelyu/fastainn_setup.git or download the zip
  3. config the VM (in Vagrantfile):

Forward the port used by jupyter notebook to localhost

config.vm.network "forwarded_port", guest: 8888, host: 8888

Config the synced forder from host computer to VM

config.vm.synced_folder "./data", "/data"
config.vm.synced_folder "./course", "/home/vagrant/course"

Setup the VM memory

vb.memory = "8196"

2G RAM is not enough for even the minimum batch_size 4
8G RAM is OK for batch_size 16

See http://gogojimmy.net/2013/05/26/vagrant-tutorial/ for more detail about the Vagrantfile

  1. in repository root folder run vagrant up to boot the VM
  2. use vagrant ssh to login the VM
  3. cd ../../data and ./install-gpu_modified.sh to install and config Anaconda, theano, keras, cudnn and jupyter notebook
  4. vim ~/.jupyter/jupyter_notebook_config.py to change the password of jupyter server (I have failed to config the password in the step, so I run the step 9. instead)
  5. logout and then login the VM again to source the jupyter environment variable.
  6. cd ~/course/nbs/ and jupyter notebook password to change the password of jupyter server
  7. In directory ~/course/nbs/, run jupyter notebook to start the server
  8. In host computer browser, enter localhost:8888 and type the password to access the notebook

Run lesson1

  1. Run ./get-lesson1.sh
  2. vim ~/.theanorc modify [global] device=gpu to [global] device=cpu
  3. vim ~/.keras/keras.json to setup the backend as theano

vagrant hotkey

vagrant 是一個可以方便設定虛擬機的工具,背後要用到 virtual box。但使用起來比 vb 還要輕量很多,
ref: http://gogojimmy.net/2013/05/26/vagrant-tutorial/

  • vagrant up VM 開機
  • vagrant ssh ssh 登入 VM,預設 port 22
  • vagrant halt VM 關機,建議沒事不用關機
  • vagrant suspend VM 暫停,這個即使整台電腦重開也可以回復狀態
  • vagrant resume 回復 VM 狀態
  • vagrant box add 加入 box
  • vagrant box list 列出所有 box
  • vagrant init 產生 default 的 Vagrantfile

tmux hotkey

讓 terminal 可以以一次跑多個程式,並可以儲存或還原目前的狀態,
ref: http://blog.chh.tw/posts/tmux-terminal-multiplexer/

  • tmux 開啟 tmux
  • tmux attach 回復之前 detach 的狀態
  • ctrl+b+" 產生上下分割視窗
  • ctrl+b+% 產生左右分割視窗
  • ctrl+b+o 切換游標的位置
  • ctrl+b+d detach 目前狀態,回到原先的介面,程式還在背景執行

jupyter notebook hotkey

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.