Giter Club home page Giter Club logo

fastai's Introduction

Build Status

fastai

The fastai library simplifies training fast and accurate neural nets using modern best practices. See the fastai website to get started. The library is based on research in to deep learning best practices undertaken at fast.ai, and includes "out of the box" support for vision, text, tabular, and collab (collaborative filtering) models. For brief examples, see the examples folder; detailed examples are provided in the full documentation. For instance, here's how to train an MNIST model using resnet18 (from the vision example):

untar_data(MNIST_PATH)
data = image_data_from_folder(MNIST_PATH)
learn = ConvLearner(data, tvm.resnet18, metrics=accuracy)
learn.fit(1)

Note for course.fast.ai students

If you are using fastai for any course.fast.ai course, you need to use fastai 0.7.x. Please ignore the rest of this document, which is written for fastai 1.0.x, and instead follow the installation instructions here.

Note: If you want to learn how to use fastai v1 from its lead developer, Jeremy Howard, he will be teaching it in the Deep Learning Part I course at the University of San Francisco from Oct 22nd, 2018.

Installation

fastai-1.x can be installed with either conda or pip package managers and also from source. At the moment you can't just run install, since you first need to get the correct pytorch version installed - thus to get fastai-1.x installed choose one of the installation recipes below using your favourite python package manager.

If there is no pytorch preview conda or pip package available for your system, you may still be able to build it from source.

Conda Install

Follow the following 2 steps in this exact order:

  1. Install the nightly pytorch build and the corresponding torchvision package. Depending on whether you have a CUDA-enabled system or not, follow the corresponding "GPU" or the "CPU" entry instructions:

    • GPU

      For CUDA-enabled systems, you need to choose the correct cudaXX conda package version, matching your system's setup. For example, for CUDA 9.2:

      conda install -c pytorch pytorch-nightly cuda92
      conda install -c fastai torchvision-nightly
      

      If you have a different CUDA version, find the right instructions for the first command here. Choose Preview/Your OS/Conda/Python3.6|Python3.7 and your CUDA version and it will give you the correct installation instruction.

    • CPU

      For systems without CUDA:

      conda install -c pytorch pytorch-nightly-cpu
      conda install -c fastai torchvision-nightly-cpu
      
  2. Install fastai:

    conda install -c fastai fastai
    

If you experience installation problems, please read about installation issues.

PyPI Install

Follow the following 2 steps in this exact order:

  1. Install the nightly pytorch build. Depending on whether you have a CUDA-enabled system or not, follow the corresponding "GPU" or the "CPU" entry instructions:

    • GPU

      For CUDA-enabled systems, you need to choose the correct cudaXX pip package version, matching your system's setup. For example, for CUDA 9.2:

      pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu92/torch_nightly.html
      

      If you have a different CUDA version, find the right build here. Choose Preview/Your OS/Pip/Python3.6|Python3.7 and your CUDA version and it will give you the correct installation instruction.

    • CPU

      For systems without CUDA:

      pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
      
  2. Install fastai:

    pip install fastai
    

    NB: this will also fetch torchvision-nightly, which supports torch-1.x.

If you experience installation problems, please read about installation issues.

Developer Install

First, follow the instructions above for either PyPi or Conda. Then uninstall the fastai package using the same package manager you used to install it, i.e. pip uninstall fastai or conda uninstall fastai, and then, replace it with a pip editable install.

git clone https://github.com/fastai/fastai
cd fastai
tools/run-after-git-clone
pip install -e .[dev]

You can test that the build works by starting the jupyter notebook:

jupyter notebook

and executing an example notebook. For example load examples/tabular.ipynb and run it.

Alternatively, you can do a quick CLI test:

jupyter nbconvert --execute --ExecutePreprocessor.timeout=600 --to notebook examples/tabular.ipynb

If anything goes wrong please read and report installation issues.

Please refer to CONTRIBUTING.md and develop.md for more details on how to contribute to the fastai project.

Installation Issues

If the installation process fails, first make sure your system is supported. And if the problem is still not addressed, please see this installation issues thread.

If you encounter installation problems with conda, make sure you have the latest conda client:

conda update conda

Is My System Supported?

  1. Python: You need to have python 3.6 or higher

  2. Operating System:

    Since fastai-1.0 relies on pytorch-1.0, you need to be able to install pytorch-1.0 first.

    As of this moment pytorch.org's pre-1.0.0 version (torch-nightly) supports:

    Platform GPU CPU
    linux binary binary
    mac source binary
    windows source source

    Legend: binary = can be installed directly, source = needs to be built from source.

    This will change once pytorch 1.0.0 is released and installable packages made available for your system, which could take some time after the official release is made. Please watch for updates here.

    If your system is currently not supported, please consider installing and using the very solid "v0" version of fastai. Please see the instructions.

Copyright

Copyright 2017 onwards, fast.ai, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.

fastai's People

Contributors

jph00 avatar sgugger avatar stas00 avatar yanneta avatar sebastianruder avatar racheltho avatar bearpelican avatar mcskinner avatar wdhorton avatar sampathweb avatar cuddle-cuddle avatar radekosmulski avatar neia20 avatar piotrczapla avatar hiromis avatar sjdlloyd avatar ohmeow avatar anandsaha avatar mcleavey avatar adityasoni19031997 avatar lchen23 avatar aayux avatar sudarshan85 avatar supreethmanyam avatar hermesdt avatar keremturgutlu avatar rcoh avatar gokkulnath avatar movefast avatar panozzaj avatar

Watchers

James Cloos avatar JeremyS avatar paper2code - bot avatar

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.