In practice, quite often there will be a need to run Jupyter Notebook in the cloud, wanting to spend as little effort as possible on it and still get a reliable and efficient computing environment.
This task can be useful both to students for practical work and in real projects for solving real problems.
So, let's choose one of the cloud services to run Python in the Jupyter Notebook and find out what other features are available in this environment.
It’s very good if such a cloud service is available in a free account.
Cloud computing for AI and ML
There is no doubt that now in many cloud systems all kinds of solutions are available for machine learning and artificial intelligence.
These cloud solutions can be multi-purpose, for solving general problems, or specialized for solving narrow problems such as in the fields of natural language processing, computer vision, etc.
Such solutions are now available on the market from major cloud service providers. Therefore, the cloud provider described in this article is an example, and you can find a similar approach for running Jupyter Notebook for your cloud provider.
Why Tensorflow?
Why Tensorflow? Because it allows the following functionality:
one of the most powerful computing environments
system using dataflow
ability to use GPU
the availability of ready-made and proven mathematical methods for neural networks
high-level access in Python
availability of rapid prototyping system on Keras
Well, in general, this system is very common in the community, is used in huge projects and is free to use.
Why Jupyter notebook?
Jupyter Notebook is a very interesting IDE, In fact, it is also the de facto standard for developers of neural networks, machine learning, and artificial intelligence.
Jupyter Notebook has very interesting properties as a development environment:
has the ability to run in the browser
can be installed on the server and on the local computer
each piece of code can be run separately
can draw graphics and display photos
support interactive data science and scientific computing
extensible solutions by installing libraries
various programming languages can be used (Python, R, Julia)
it is free
Finding Cloud solution with Jupyter
As we have said, the cloud solution for launching Jupyter Notebook is already available from many leading vendors, including:
Amazon's SageMaker Notebooks
Google's Colaboratory
Microsoft's Azure Notebook
and Jupyo
Let's dwell on one of the popular cloud providers, Google Colab. This cloud provider gives you access to Jupyter Notebook for free and out of the box and has very remarkable properties.
Fig. 2. Welcome to the Colaboratory tutorial in Jupyter Notebook
In addition, you can configure the runtime kernel in two more ways: hosted runtime and local runtime. This makes it possible to use another server (for example, on your computer) for the computing runtime.
Fig. 3. Connecting to hosted or local runtime
Cloud Development Solutions Require the Most Reliable PartnersExplore how Svitla Systems can accelerate your cloud journey with expertise and innovative solutions.Contact Us
Running Tensorflow, Numpy, Scipy, and OpenCV
Let's open a new project in Jupyter Notebook via the “File” menu (“New Python 3 Notebook”).
Fig. 4. Opening a new Notebook in Google Colab
Now, let's enter two lines of code into the cell and click the circle with an arrow to launch Tensorflow. This Python code will print the version of the Tensorflow, in our case 1.14.0
Fig. 5. Running Tensorflow library in Jupyter Notebook
And in the same way, you can run numpy, scipy, and opencv.
Fig. 6. Running numpy, scipy, and opencv on Jupyter Notebook
And what if your favorite Python library is not installed in Google Colab? There is a way to fix this.
!pip install yourlibrary
Where yourlibrary is the name of your library. We show this using the seaborn library (statistical data visualization - seaborn) as an example.
Fig. 7. Installing a new Python library in Google Colab
Additional features of Google Colab
It is worth noting separately the following features in Google Colab.
These are such great features for a free account. For instance, for working with data Google Colab allows:
Loading data: Google Drive, Sheets, and Google Cloud Storage
Charts: visualizing data
Using BigQuery
And, in addition to this, again, in a free account, using accelerated hardware is available:
TensorFlow with GPUs
TensorFlow with TPUs
To do this, turn on the GPU. In the menu Edit-> Notebook settings, select the option Hardware Accelerator -> GPU. Fig. 8. Setting Google Colab to use GPU
And then run this code to check for the presence of the GPU:
Fig. 9. Testing GPU on Google Colab
In the same way, you can use TPU (Tensor Processing Unit) on Google Colab.
Conclusion
Let's summarize the possibilities of developing machine learning and artificial intelligence projects in cloud environments. We took only one cloud provider as an example. But you can take advantage of other solutions that provide similar functionality to run Jupyter Notebook in the cloud. What are the benefits of this:
firstly, you can work with a Notebook from any computer
store project files on Google Drive
use the coolest libraries for Python
use about 12 Gb of memory for runtime
if necessary, deliver the necessary libraries
switch to Tensorflow version 2
build graphs and display photos
and soon the implementation for the AR language will be released
lead joint development using the GIT repository
use GPU and TPU even in a free account
switch to the required runtime on your computer
And this cloud solution can be both an additional development environment for your project, and one of the main effective tools.
Written by
Svitla Team
FAQ
Can I run Jupyter notebook online?
Yes, running the Jupyter Notebook online through various cloud services such as Google Colab, Amazon SageMaker Notebooks, and Microsoft Azure Notebooks is very easy. One popular free model is Google Colab. It equips users with Jupyter Notebooks straight in their browser and supports Python libraries, GPU/TPU acceleration, and integration with Google Drive and GitHub. Access to your notebook from any PC in the World.
Can I run TensorFlow online?
Yes, you can run TensorFlow in the cloud. It now supports running on such cloud-based platforms, which make it easy to use Python and ML environments. For example, Google Colab allows you to develop and run your TensorFlow code in the browser. They offer free GPUs and TPUs to speed up your code execution.
How to install TensorFlow in online Jupyter Notebook?
When using an online Jupyter Notebook environment like Google Colab, TensorFlow often comes pre-installed, so you can usually start using it immediately. To verify its presence or to install a specific version, you can simply run !pip install tensorflow in a code cell. This command will handle the installation within your cloud-based notebook session, allowing you to import and use TensorFlow for your projects.
How do I open a notebook in Google Cloud?
To open a notebook in Google Cloud, you can navigate to Google Colaboratory (Colab) by visiting colab.research.google.com. From there, you can open existing notebooks from your Google Drive, upload a file from your computer, or even import one directly from a GitHub repository. This seamless integration allows you to access and work on your Jupyter notebooks directly within the cloud environment.