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 :
- tsnecuda-benchmark on Colab
- Fangda Han’s article on Medium
- Photo by Toa Heftiba on Unsplash
THE PANE METHOD FOR DEEP LEARNING!
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 :