OSError: no file with expected extension when running tsne using the tsnecuda package

22 views Asked by At

I have tried to install tsnecuda, following the instructions outline here and thought I had performed it successfully.

I am using CUDA 12.2 so I pip installed the following:

pip3 install tsnecuda==3.0.1+cu122 -f https://tsnecuda.isx.ai/tsnecuda_stable.html

However, when i test it using the following code:

from tsnecuda import TSNE
X = np.array([[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
X_embedded = TSNE().fit_transform(X)

I get the following error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[19], line 3
      1 from tsnecuda import TSNE
      2 X = np.array([[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
----> 3 X_embedded = TSNE().fit_transform(X)

File ~\anaconda3\envs\spyder\Lib\site-packages\tsnecuda\TSNE.py:139, in TSNE.__init__(self, n_components, perplexity, early_exaggeration, learning_rate, num_neighbors, force_magnify_iters, pre_momentum, post_momentum, theta, epssq, n_iter, n_iter_without_progress, min_grad_norm, perplexity_epsilon, metric, init, return_style, num_snapshots, verbose, random_seed, use_interactive, viz_timeout, viz_server, dump_points, dump_file, dump_interval, print_interval, device, magnitude_factor)
    137 # Build the hooks for the BH T-SNE library
    138 self._path = os.path.dirname(__file__)
--> 139 self._lib = N.ctypeslib.load_library(
    140     'libtsnecuda', self._path)  # Load the ctypes library
    142 # Hook the BH T-SNE function
    143 self._lib.pymodule_tsne.restype = None

File ~\anaconda3\envs\spyder\Lib\site-packages\numpy\ctypeslib.py:161, in load_library(libname, loader_path)
    159             raise
    160 ## if no successful return in the libname_ext loop:
--> 161 raise OSError("no file with expected extension")

OSError: no file with expected extension

...which I can't for the life of me work back to to figure it out.

I have tried reinstalling the package again as a first attempt but that hasn't helped.

Any suggestions would be greatly appreciated.

0

There are 0 answers