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
condacolab.install()

Finally we install the dependencies to tsnecuda :

!wget https://anaconda.org/CannyLab/tsnecuda/2.1.0/download/linux-64/tsnecuda-2.1.0-cuda101.tar.bz2
!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: libcublas.so.9.0’.

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 :

One last word, if you want to go further and learn about Deep Learning - I've prepared for you the Action plan to Master Neural networks. for you.

7 days of free advice from an Artificial Intelligence engineer to learn how to master neural networks from scratch:

  • Plan your training
  • Structure your projects
  • Develop your Artificial Intelligence algorithms

I have based this program on scientific facts, on approaches proven by researchers, but also on my own techniques, which I have devised as I have gained experience in the field of Deep Learning.

To access it, click here :

GET MY ACTION PLAN

GET MY ACTION PLAN

Tom Keldenich
Tom Keldenich

Artificial Intelligence engineer and data enthusiast!

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.



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.