Creating a Jupyter Notebook

Creating a Jupyter Notebook

In this tutorial, we'll show how you can create your one-click Jupyter notebook on Gradient.

What is a Notebook?

Gradient notebooks are an interactive environment (based on Jupyter Notebook or Jupyter Lab) for developing and running code. You can run Jupyter notebooks on a GPU, CPU, or even a TPU.

A Gradient Notebook gives you access to a full Jupyter Notebook environment. Within the Notebook, you can store an unlimited number of documents and other files. You can think of a Gradient Notebook as your persistent, on-demand workspace in the cloud.

NEW!  Visit the new ML Showcase for a list of sample projects you can fork into your own account.

File Storage

Any data stored in /storage will be preserved for you, across restarts. Persistent storage is backed by a filesystem and is ideal for storing data like images, datasets, model checkpoints etc.  Learn more about persistent storage here.

Containers

Because everything is running in a Docker container behind the scenes, we support any kernel you would like. We have a handful of pre-built containers and you can easily add a custom container or build one from a base template, such as the Jupyter R stack.  

View the list of pre-built containers here.

Environment Variables

There are a number of environment variables loaded into a notebook's environment, which you can access and use. Probably most common is is PS_API_KEY , which will contain your most recently created API key (if you've created one). In combination with the Gradient SDK, this allows you to programmatically interact with Gradient.

  • Jupyter Notebooks are a powerful yet user-friendly tool for developing machine learning and deep learning projects. In this tutorial we’ll look at how to launch a Jupyter Notebook on Gradient by choosing a container, choosing a machine to run it on, and setting our notebook options like its name, run time, and privacy settings.
  • Let’s get started.
  • In this tutorial we’re using the free Gradient Community Notebooks, but the process will look the same for the paid plans as well. To launch the notebook instance, start by going to gradient.paperspace.com and logging into your account. From there, hover over the navigation bar on the left, and go down to “Notebooks.” 
  • First we’ll choose between the different options for our notebook environment. You can select from one of the pre-configured environments, with backends like TensorFlow, PyTorch, or a combination of popular frameworks, or you can create a custom container for the specific environment you want. In this tab you can see all of the containers you can choose from. But to keep things simple, here we’ll stick to the “All-in-one” recommended container, which includes all major machine learning frameworks pre-configured and ready to use.
  • Next we’ll choose our machine. If you want, you can also filter for “low-cost” instances, but these are preemptible and might get interrupted at any time. We’re using a free notebook, so we’ll select the free P5000 GPU, which comes with 8 CPUs, 30 GB of RAM and 250 GB of solid state storage. 
  • Now we just specify a few additional settings before we’re finished. We can give our notebook a name, specify the amount of time before it shuts down automatically, and set the privacy. For paid plans you can keep the notebook running for longer periods of time, like 12 hours, a day, or even a week. The free notebooks can be run for a maximum of 6 hours, but you can always start it again whenever you need. The free notebooks are also set to public automatically, but for paid plans we can switch this to private.
  • Now, just hit “Create Notebook” and that’s it. In a few minutes your notebook will be ready to go. Click on the “Open” button to access your notebook. Use “V1” for the classic Jupyter look, or “V2” for JupyterLab. JupyterLab is a web-based user interface which offers more features than classic Jupyter Notebooks, but for getting started, classic Jupyter is more than enough.
  • That’s how you can quickly launch a ready-to-go Jupyter Notebook on Paperspace Gradient.

Key takeaways

  • Launch a new notebook from a preloaded or custom container
  • Choose an instance type including a free GPU
  • Share your work and explore other projects

Similar videos