How to simply use TSNE CUDA on Google Colab – Best Way

Blocked to use the TSNE CUDA library on Google Colab ? You’ ll find here a step by step tutorial to use it !

It took me a long time to find out how to use TSNE CUDA on Colab.

And often it just takes a little line of code that will work like magic.

For TSNE Cuda, you will find the solution in this article !

The dependencies

First of all, let’s install the tsnecuda library:

!pip install tsnecuda

Next, we will need to use conda for this tutorial !

The installation on Google Colab is singular. It has been detailed in this article.

The code itself :

!pip install -q condacolab
import condacolab

Finally we install the dependencies to tsnecuda :

!tar xvjf tsnecuda-2.1.0-cuda101.tar.bz2
!cp -r site-packages/* /usr/local/lib/python3.7/dist-packages/

Thanks to them we avoid the redundant error: ‘ImportError:’.

Finally, a last dependency allows us to use cuda with tsnecuda :

!conda install --offline tsnecuda-2.1.0-cuda101.tar.bz2

And voilà ! We’re now…

… Ready to use TSNE CUDA on Colab !

Just import the tsnecuda library:

import tsnecuda

Then test if it works with this short code :

from tsnecuda import TSNE as TSNE_CUDA

tsne_cuda = TSNE_CUDA(n_components=2, verbose=0)

Didn’t get any error ? Congratulations ! You’re good to create your own TSNE schemas !

By the way, we will describe in a future article a concrete use case for TSNE sentences visualization.

Still having troubles even after this tutorial ? Feel free to share about it in the comments, we regularly update our articles 😉

sources :


Get your 7 DAYS FREE TRAINING to learn how to create your first ARTIFICIAL INTELLIGENCE!

For the next 7 days I will show you how to use Neural Networks.

You will learn what Deep Learning is with concrete examples that will stick in your head.

BEWARE, this email series is not for everyone. If you are the kind of person who likes theoretical and academic courses, you can skip it.

But if you want to learn the PANE method to do Deep Learning, click here :

Tom Keldenich
Tom Keldenich

Data Engineer & passionate about Artificial Intelligence !

Founder of the website Inside Machine Learning

Leave a Reply

Your email address will not be published. Required fields are marked *

This page will not stay online forever

Enter your email to receive for free

The PANE method for Deep Learning

* indicates required


You will receive one email per day for 7 days – then you will receive my newsletter.
Your information will never be given to third parties.

You can unsubscribe in 1 click from any of my emails.

Cette page ne restera pas en ligne éternellement

Entre ton email pour recevoir gratuitement
la méthode PARÉ pour faire du Deep Learning

Tu recevras un email par jour pendant 7 jours - puis tu recevras ma newsletter.
Tes informations ne seront jamais cédées à des tiers.

Tu peux te désinscrire en 1 clic depuis n'importe lequel de mes emails.