├── README.md ├── fastai-v2 ├── Dockerfile ├── Instructions.md ├── README.md └── run.sh └── fastai-v3 ├── Dockerfile ├── Instructions.md ├── README.md ├── config.yml ├── enviroment.yaml └── run.sh /README.md: -------------------------------------------------------------------------------- 1 | Please note: This repository has been deprecated in favor of our new release: https://github.com/Paperspace/fastai-docker 2 | 3 | # Paperspace + Fast.ai Docker Files 4 | This repos containers dockerfiles for use with Fast.ai online courses. Each folder corresponds with the verion of the Fast.ai course you are participating in. Course version specific readme files are provided within each subdirectory. 5 | -------------------------------------------------------------------------------- /fastai-v2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 2 | 3 | LABEL com.nvidia.volumes.needed="nvidia_driver" 4 | 5 | RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | build-essential \ 9 | cmake \ 10 | git \ 11 | curl \ 12 | vim \ 13 | ca-certificates \ 14 | libnccl2=2.2.13-1+cuda9.0 \ 15 | libnccl-dev=2.2.13-1+cuda9.0 \ 16 | python-qt4 \ 17 | libjpeg-dev \ 18 | zip \ 19 | unzip \ 20 | bzip2 \ 21 | libpng-dev &&\ 22 | rm -rf /var/lib/apt/lists/* 23 | 24 | 25 | ENV PYTHON_VERSION=3.6 26 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 27 | chmod +x ~/miniconda.sh && \ 28 | ~/miniconda.sh -b -p /opt/conda && \ 29 | rm ~/miniconda.sh && \ 30 | /opt/conda/bin/conda install conda-build -y 31 | 32 | 33 | WORKDIR /notebooks 34 | 35 | RUN git clone --single-branch --branch v0.7.1 https://github.com/fastai/fastai.git . 36 | RUN ls && /opt/conda/bin/conda env create 37 | RUN /opt/conda/bin/conda clean -ya 38 | 39 | ENV PATH /opt/conda/envs/fastai/bin:$PATH 40 | ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 41 | ENV USER fastai 42 | 43 | CMD source activate fastai 44 | CMD source ~/.bashrc 45 | 46 | RUN /opt/conda/bin/conda install --name fastai -c conda-forge jupyterlab 47 | 48 | WORKDIR /data 49 | 50 | RUN curl http://files.fast.ai/data/dogscats.zip --output dogscats.zip 51 | RUN unzip -d . dogscats.zip 52 | RUN rm dogscats.zip 53 | 54 | # occurs in entrypoint now 55 | # RUN ln -s /data/ /notebooks/courses/dl1/ 56 | 57 | RUN chmod -R a+w /notebooks 58 | 59 | ENV PATH /opt/conda/bin:$PATH 60 | WORKDIR /notebooks 61 | 62 | ENV PATH /opt/conda/envs/fastai/bin:$PATH 63 | 64 | COPY run.sh /run.sh 65 | 66 | CMD ["/run.sh"] 67 | -------------------------------------------------------------------------------- /fastai-v2/Instructions.md: -------------------------------------------------------------------------------- 1 | # Fast.ai Deep Learning Course v3 on Gradient Notebooks 2 | 3 | This is a quick guide to starting Part 3 of the fast.ai course Practical Deep Learning for Coders using Gradient Notebooks. With Gradient, you get quick access to a Jupyter instance (Lab or Notebook) without having to set up a virtual machine. Paperspace is a GPU-accelerated cloud platform 4 | 5 | ### Summary of Charges 6 | There are no storage fees associated with using Gradient Notebooks. Users pay hourly usage fees for the time that their Notebooks are Running. The hourly rate is dependent on the Compute Type selected, see all available types [here](https://support.paperspace.com/hc/en-us/articles/360002484474-Gradient-Pricing). Notebooks must be stopped to end billing. Learn more about Gradient billing [here](https://support.paperspace.com/hc/en-us/articles/360001369914-How-Does-Gradient-Billing-Work-). 7 | 8 | ## Getting Set Up 9 | ### Step 1: Create a Paperspace Account 10 | If you haven't already, you'll need to sign up for Paperspace [here](https://www.paperspace.com/account/signup). Confirm your account using the link in the email you receive from Paperspace. [Sign in to Paperspace](https://www.paperspace.com/account/login). 11 | 12 | ![image](https://user-images.githubusercontent.com/585865/47126635-76af7c80-d257-11e8-8f33-b34be1ae8ef3.png) 13 | 14 | 15 | ### Step 2: Access Gradient & Create Notebook 16 | I. On the left-hand side of your Console under Gradient, select Notebooks. 17 | 18 | II. Select the *Fast.ai 1.0 / PyTorch 1.0 BETA* base container. 19 | 20 | **Note: for Pro users, learn more about this docker container at the [paperspace/fastai-docker repo](https://github.com/Paperspace/fastai-docker/tree/fastai/pytorch1.0)** 21 | 22 | ![image](https://user-images.githubusercontent.com/585865/47126835-719efd00-d258-11e8-8d8d-b402ef8baecc.png) 23 | 24 | 25 | III. Select your Compute Type. 26 | 27 | ![](https://support.paperspace.com/hc/article_attachments/360006919793/mceclip0.png) 28 | 29 | IV. Name your Notebook. 30 | 31 | V. Enter your payment details (if you're new to Paperspace). Even if you have a promo or referral code, all active Paperspace accounts must have a valid credit card on file. You'll be able to enter your promo code later. 32 | 33 | VI. Click Create Notebook 34 | 35 | When you click Create Notebook, that will start your Notebook and your billing for utilization will begin. To stop billing, you must stop your Notebook. Notebooks will automatically shut down after 12 hours. 36 | 37 | You'll be taken to your Notebook details page in your Console, where your Notebook will be created. It will go straight from Pending to Running, and will be ready to use. 38 | 39 | ### Step 3: Stopping your Notebook 40 | Under Action, just click stop. This will end the billing session. 41 | 42 | ![image](https://user-images.githubusercontent.com/585865/47126987-29340f00-d259-11e8-8432-10e47d3edbe0.png) 43 | 44 | ### Step 4: Restart your Notebook 45 | Click Start to pick up where you left off, and/or choose a different VM type on which you'd like to run your Notebook. 46 | 47 | --- 48 | 49 | The Compute Type of your Notebook can be changed when you start it. What this means for you is that you can prepare your work inexpensively and add a GPU when you're ready to run your model/algorithm. 50 | 51 | ![](https://support.paperspace.com/hc/article_attachments/360012358634/mceclip0.png) 52 | 53 | ## Managing Data 54 | Fast.ai data files (dogscats) can be found in the 'datasets' folder. Files in this directory are hosted by Paperspace and are read-only. See [Public Datasets](https://support.paperspace.com/hc/en-us/articles/360003092514-Public-Datasets) for more info. 55 | 56 | The `storage` folder is your [Persistent Storage](https://support.paperspace.com/hc/en-us/articles/360001468133-Persistent-Storage). Files placed here are available across runs of Paperspace Jobs, Notebooks, and Linux machines. Empty by default, this repository is meant to store training datasets. 57 | 58 | The rest of the files in the notebooks directories will be available as Artifacts when your notebook is stopped. 59 | 60 | ## Wrapping up 61 | Paperspace provides $10 of Gradient credit to start you off on your course. This code is to be used for fast.ai students only. In your console, click on Billing in the left-hand menu and enter the promo code at the bottom right. The promo code for this course is: *FASTAIGR45T*. 62 | 63 | Note: If you opt for a Gradient 1 Subscription, promotional credit does not apply. Learn more about Gradient Subscription levels here. 64 | 65 | Questions or issues related to course content, we recommend posting in the [fast.ai forum](http://forums.fast.ai/). 66 | 67 | For Paperspace-specific support, check out the rest of the Gradient Help Center or submit a support ticket with [this form](https://support.paperspace.com/hc/en-us/requests/new). 68 | -------------------------------------------------------------------------------- /fastai-v2/README.md: -------------------------------------------------------------------------------- 1 | # Paperspace + Fast.ai Docker files 2 | 3 | 4 | ## Overview 5 | 6 | This is a docker build file designed to work with [Paperspace]. The latest pre-built runtimes are pushed here: https://hub.docker.com/r/paperspace/fastai/ 7 | 8 | This container pulls the latest fast.ai class. You can find this repo here: https://github.com/fastai/fastai and you can learn more about the Fast.ai course here: http://course.fast.ai/ 9 | 10 | ## Requirements: 11 | 12 | [Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) 13 | 14 | [NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker) 15 | 16 | Nvidia Drivers 17 | 18 | 19 | ## Build 20 | 21 | `sudo docker build -t paperspace/fastai .` 22 | 23 | ## Pre-built runtimes 24 | 25 | You can also just run the following without having to build the entire container yourself. This will pull the container from Docker Hub. 26 | 27 | `sudo docker run --runtime=nvidia -d -p 8888:8888 paperspace/fastai:0.7-CUDA9-base-2.0` 28 | -------------------------------------------------------------------------------- /fastai-v2/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -s /data/ /notebooks/courses/dl1/ 4 | jupyter lab --ip=0.0.0.0 --no-browser --allow-root 5 | -------------------------------------------------------------------------------- /fastai-v3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.2-base-ubuntu16.04 2 | # See http://bugs.python.org/issue19846 3 | ENV LANG C.UTF-8 4 | LABEL com.nvidia.volumes.needed="nvidia_driver" 5 | 6 | RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list 7 | 8 | RUN apt-get update && apt-get install -y --no-install-recommends \ 9 | build-essential \ 10 | cmake \ 11 | git \ 12 | curl \ 13 | vim \ 14 | ca-certificates \ 15 | python-qt4 \ 16 | libjpeg-dev \ 17 | zip \ 18 | unzip \ 19 | libpng-dev &&\ 20 | rm -rf /var/lib/apt/lists/* 21 | 22 | ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 23 | ENV PYTHON_VERSION=3.6 24 | 25 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 26 | chmod +x ~/miniconda.sh && \ 27 | ~/miniconda.sh -b -p /opt/conda && \ 28 | rm ~/miniconda.sh && \ 29 | /opt/conda/bin/conda install conda-build 30 | 31 | ENV PATH=$PATH:/opt/conda/bin/ 32 | ENV USER fastai 33 | # Create Enviroment 34 | COPY enviroment.yaml /enviroment.yaml 35 | RUN conda env create -f enviroment.yaml 36 | 37 | WORKDIR /notebooks 38 | # Activate Source 39 | CMD source activate fastai 40 | CMD source ~/.bashrc 41 | 42 | RUN chmod -R a+w /notebooks 43 | WORKDIR /notebooks 44 | 45 | # Clone course-v3 46 | RUN git clone https://github.com/fastai/course-v3.git 47 | 48 | COPY config.yml /root/.fastai/config.yml 49 | COPY run.sh /run.sh 50 | 51 | CMD ["/run.sh"] 52 | -------------------------------------------------------------------------------- /fastai-v3/Instructions.md: -------------------------------------------------------------------------------- 1 | # Fast.ai Deep Learning Course v3 on Gradient Notebooks 2 | 3 | This is a quick guide to starting Part 3 of the fast.ai course Practical Deep Learning for Coders using Gradient Notebooks. With Gradient, you get quick access to a Jupyter instance (Lab or Notebook) without having to set up a virtual machine. Paperspace is a GPU-accelerated cloud platform 4 | 5 | ### Summary of Charges 6 | There are no storage fees associated with using Gradient Notebooks. Users pay hourly usage fees for the time that their Notebooks are Running. The hourly rate is dependent on the Compute Type selected, see all available types [here](https://support.paperspace.com/hc/en-us/articles/360002484474-Gradient-Pricing). Notebooks must be stopped to end billing. Learn more about Gradient billing [here](https://support.paperspace.com/hc/en-us/articles/360001369914-How-Does-Gradient-Billing-Work-). 7 | 8 | ## Getting Set Up 9 | ### Step 1: Create a Paperspace Account 10 | If you haven't already, you'll need to sign up for Paperspace [here](https://www.paperspace.com/account/signup). Confirm your account using the link in the email you receive from Paperspace. [Sign in to Paperspace](https://www.paperspace.com/account/login). 11 | 12 | ![image](https://user-images.githubusercontent.com/585865/47126635-76af7c80-d257-11e8-8f33-b34be1ae8ef3.png) 13 | 14 | 15 | ### Step 2: Access Gradient & Create Notebook 16 | I. On the left-hand side of your Console under Gradient, select Notebooks. 17 | 18 | II. Select the *Fast.ai 1.0 / PyTorch 1.0 BETA* base container. 19 | 20 | **Note: for Pro users, learn more about this docker container at the [paperspace/fastai-docker repo](https://github.com/Paperspace/fastai-docker/tree/fastai/pytorch1.0)** 21 | 22 | ![image](https://user-images.githubusercontent.com/585865/47126835-719efd00-d258-11e8-8d8d-b402ef8baecc.png) 23 | 24 | 25 | III. Select your Compute Type. 26 | 27 | ![](https://support.paperspace.com/hc/article_attachments/360006919793/mceclip0.png) 28 | 29 | IV. Name your Notebook. 30 | 31 | V. Enter your payment details (if you're new to Paperspace). Even if you have a promo or referral code, all active Paperspace accounts must have a valid credit card on file. You'll be able to enter your promo code later. 32 | 33 | VI. Click Create Notebook 34 | 35 | When you click Create Notebook, that will start your Notebook and your billing for utilization will begin. To stop billing, you must stop your Notebook. Notebooks will automatically shut down after 12 hours. 36 | 37 | You'll be taken to your Notebook details page in your Console, where your Notebook will be created. It will go straight from Pending to Running, and will be ready to use. 38 | 39 | ### Step 3: Stopping your Notebook 40 | Under Action, just click stop. This will end the billing session. 41 | 42 | ![image](https://user-images.githubusercontent.com/585865/47126987-29340f00-d259-11e8-8432-10e47d3edbe0.png) 43 | 44 | ### Step 4: Restart your Notebook 45 | Click Start to pick up where you left off, and/or choose a different VM type on which you'd like to run your Notebook. 46 | 47 | --- 48 | 49 | The Compute Type of your Notebook can be changed when you start it. What this means for you is that you can prepare your work inexpensively and add a GPU when you're ready to run your model/algorithm. 50 | 51 | ![](https://support.paperspace.com/hc/article_attachments/360012358634/mceclip0.png) 52 | 53 | ## Managing Data 54 | Fast.ai data files (dogscats) can be found in the 'datasets' folder. Files in this directory are hosted by Paperspace and are read-only. See [Public Datasets](https://support.paperspace.com/hc/en-us/articles/360003092514-Public-Datasets) for more info. 55 | 56 | The `storage` folder is your [Persistent Storage](https://support.paperspace.com/hc/en-us/articles/360001468133-Persistent-Storage). Files placed here are available across runs of Paperspace Jobs, Notebooks, and Linux machines. Empty by default, this repository is meant to store training datasets. 57 | 58 | The rest of the files in the notebooks directories will be available as Artifacts when your notebook is stopped. 59 | 60 | ## Wrapping up 61 | Paperspace provides $10 of Gradient credit to start you off on your course. This code is to be used for fast.ai students only. In your console, click on Billing in the left-hand menu and enter the promo code at the bottom right. The promo code for this course is: *FASTAIGR45T*. 62 | 63 | Note: If you opt for a Gradient 1 Subscription, promotional credit does not apply. Learn more about Gradient Subscription levels here. 64 | 65 | Questions or issues related to course content, we recommend posting in the [fast.ai forum](http://forums.fast.ai/). 66 | 67 | For Paperspace-specific support, check out the rest of the Gradient Help Center or submit a support ticket with [this form](https://support.paperspace.com/hc/en-us/requests/new). 68 | -------------------------------------------------------------------------------- /fastai-v3/README.md: -------------------------------------------------------------------------------- 1 | # Paperspace + Fast.ai Docker files 2 | 3 | 4 | ## Overview 5 | 6 | This is a docker build file designed to work with [Paperspace]. The latest pre-built runtimes are pushed here: https://hub.docker.com/r/paperspace/fastai/ 7 | 8 | This container pulls the latest fast.ai class. You can find this repo here: https://github.com/fastai/fastai and you can learn more about the Fast.ai course here: http://course.fast.ai/ 9 | 10 | This dockerfile pins the fastai "course-v3" repository to the commit hash: 2d532e82517a8b528b351fa6b2da985da0affe8b representing the master branch as of 1/24/2019 11 | 12 | ## Requirements: 13 | 14 | [Docker CE](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) 15 | 16 | [NVIDIA-docker](https://github.com/NVIDIA/nvidia-docker) 17 | 18 | Nvidia Drivers 19 | 20 | 21 | ## Build 22 | 23 | `sudo docker build -t paperspace/fastai .` 24 | 25 | ## Pre-built runtimes 26 | 27 | You can also just run the following without having to build the entire container yourself. This will pull the container from Docker Hub. 28 | 29 | `sudo docker run --runtime=nvidia -d -p 8888:8888 paperspace/fastai:1.0-CUDA9.2-base-3.0-v1.0.6` 30 | -------------------------------------------------------------------------------- /fastai-v3/config.yml: -------------------------------------------------------------------------------- 1 | data_path: /storage 2 | 3 | -------------------------------------------------------------------------------- /fastai-v3/enviroment.yaml: -------------------------------------------------------------------------------- 1 | name: fastai 2 | channels: 3 | - conda-forge 4 | - pytorch 5 | - fastai 6 | dependencies: 7 | - pytorch 8 | - torchvision 9 | - cuda92 10 | - fastprogress 11 | - fastai 12 | - jupyter 13 | - pip: 14 | - nvidia-ml-py3 15 | - dataclasses -------------------------------------------------------------------------------- /fastai-v3/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source activate fastai 3 | ln -s /storage /notebooks/course-v3/nbs/dl1/data 4 | jupyter notebook --ip=0.0.0.0 --no-browser --allow-root 5 | --------------------------------------------------------------------------------