在 Kaggle 中使用 Thundersvm

问题描述 投票:0回答:1

当我想使用'!pip install Thundersvm`在kaggle中安装thundersvm时,我遇到了这个错误:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 3
      1 get_ipython().run_line_magic('pip', 'install thundersvm')
      2 get_ipython().run_line_magic('pip', 'install keras_tuner')
----> 3 from thundersvm import SVC
      4 from sklearn.preprocessing import StandardScaler
      5 from sklearn.metrics import classification_report

File /opt/conda/lib/python3.10/site-packages/thundersvm/__init__.py:10
      3 """
      4  * Name        : __init__.py
      5  * Author      : Locke <[email protected]>
      6  * Version     : 0.0.1
      7  * Description :
      8 """
      9 name = "thundersvm"
---> 10 from .thundersvm import *

File /opt/conda/lib/python3.10/site-packages/thundersvm/thundersvm.py:39
     36         lib_path = path.join(dirname, shared_library_name)
     38 if path.exists(lib_path):
---> 39     thundersvm = CDLL(lib_path)
     40 else:
     41     # try the build directory
     42     if platform == "linux" or platform == "linux2":

File /opt/conda/lib/python3.10/ctypes/__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    371 self._FuncPtr = _FuncPtr
    373 if handle is None:
--> 374     self._handle = _dlopen(self._name, mode)
    375 else:
    376     self._handle = handle

OSError: libcusparse.so.9.0: cannot open shared object file: No such file or directory

为了解决这个问题,我尝试了以下方法:

# Download and install CUDA 9.0
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
sudo sh cuda_9.0.176_384.81_linux-run

这也不起作用。我该如何解决这个问题?

machine-learning gpu svm kaggle
1个回答
0
投票

为了解决此问题,您需要安装一些依赖项并使下载的文件可执行。

# Install missing libraries
!sudo apt-get update
!sudo apt-get install -y libglu1-mesa libx11-dev libxi-dev libxmu-dev libgl-dev

# Download and install CUDA 9.0 silently with --override to replace the current one
!wget -q https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run -O cuda_9.0.176_384.81_linux-run
!chmod +x cuda_9.0.176_384.81_linux-run
!sudo sh cuda_9.0.176_384.81_linux-run --silent --override --toolkit --samples

# Manually specify the toolkit and sample directories
!sudo sh /usr/local/cuda-9.0/bin/cuda-install-samples-9.0.sh /root

此后,您可以安装和

import
thundersvm
库。

© www.soinside.com 2019 - 2024. All rights reserved.