Skip to content

Instantly share code, notes, and snippets.

@tcvieira
Last active October 12, 2021 13:10
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tcvieira/d29d38068a6cd2c455baaaf0d183534b to your computer and use it in GitHub Desktop.
Save tcvieira/d29d38068a6cd2c455baaaf0d183534b to your computer and use it in GitHub Desktop.
Setup Fast.ai v1 on Paperspace Fast.ai Template

Setup Fastai v1 on Paperspace

Machine

  • Create a Fast.ai machine from public templates w/ P4000 and public IP

Connect to the machine

Clone fastai_v1 from GitHub

Reconfigure jupyter configuration file

Open with vim or nano

  • vim ~/.jupyter/jupyter_notebook_config.py

Edit lines

  • c.NotebookApp.allow_origin = '' to c.NotebookApp.allow_origin = '*'
  • c.NotebookApp.ip = 'localhost' to c.NotebookApp.ip = '0.0.0.0'
  • c.NotebookApp.allow_remote_access = False to c.NotebookApp.allow_remote_access = True

Then you can run the Jupyter Notebook on the fastai v1 repo directory

We're trying to run some notebook using the fastai v1 installed globally with pip

  • $ jupyter notebook

Access your Jupyter and run dogs_cats.ipynb on examples folder

  • Try to execute the first cell, if it executes you're a good to go

Let's check the fastai version

  • On the dogs_cats.ipynb notebook, add a cell with the following content:

import fastai fastai.version

  • It should print

'1.0.6'

this is the version installed with pip

Now let's try to use the fastai v1 cloned from GitHub

Uninstall the fastai pip version

  • $ pip uninstall fastai

At the fastai v1 directory cloned from GitHub, run:

  • $ tools/run-after-git-clone
  • $ pip install -e .[dev]

Start Jupyter

  • $ jupyter notebook

Let's run the dogs_cats.ipynb notebook again and check the fastai version

  • Try to execute the first cell, if it executes you're a good to go

  • Run the cell with the following content:

import fastai fastai.version

  • It should print a differente version from that one showed previously - today 10/17/2018 it was:

'1.0.7.dev0'

this is the version from the repo cloned from GitHub

VICTORY 😄 !!!!!

@alarmatwork
Copy link

c.NotebookApp.allow_remote_access = False to c.NotebookApp.allow_remote_access = True

Seems to be missing from conf file, access seems to be working without it.

But following the steps in the guide with import fastai fastai.version it gives error that fastai is missing.

@jersearls
Copy link

I also did not have the c.NotebookApp.allow_remote_access option and it worked fine. When logging into the jupyter notebook, be sure that you use the papersource ip address instead of localhost in the URL.

I also am getting the same error.

<ipython-input-4-5b8434ff0e47> in <module>()
      2 get_ipython().magic('autoreload 2')
      3 
----> 4 from fastai import *
      5 from fastai.vision import *

ModuleNotFoundError: No module named 'fastai'```

@jersearls
Copy link

I would suggest instead using the officially supported docs for new users, found here.

@f4exb
Copy link

f4exb commented Jan 17, 2019

These instructions are still useful if you have a NVidia enabled machine and you want to run locally.
Although the way to get the version number is rather:

import fastai
print(fastai.version.__version__)

@bss489
Copy link

bss489 commented Mar 16, 2019

Hi. I am in the process of installation. When I use the 'ls' command to list all the files, I do not find 'data' file. What should I do?
paperspace_fastai

@batmans
Copy link

batmans commented Jun 1, 2019

Hi. I am in the process of installation. When I use the 'ls' command to list all the files, I do not find 'data' file. What should I do?
paperspace_fastai

I have the same problem, any help or solution? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment