Xtra-Computing / thundersvm

ThunderSVM: A Fast SVM Library on GPUs and CPUs
Apache License 2.0
1.55k stars 215 forks source link

ThunderSVM in Jupyter Notebook #243

Open dani-s-92 opened 3 years ago

dani-s-92 commented 3 years ago

Hello,

I try to use thundersvm for train the svm on my local gpu with jupyter notebook. I installed thundersvm as described here (https://github.com/Xtra-Computing/thundersvm/blob/master/docs/get-started.md) and it worked after I Had to try a few times. After that I build the solution in Visual Studio 17.

If I try to import thundersvm (from thundersvm import SVC) in Jupyter Notebook the following error occurs:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-8-4dd69a86c168> in <module>
     55 from sklearn.preprocessing import MultiLabelBinarizer
     56 from sklearn.utils import class_weight
---> 57 from thundersvm import SVC

~\anaconda3\envs\gpu_p36\lib\site-packages\thundersvm\__init__.py in <module>
      8 """
      9 name = "thundersvm"
---> 10 from .thundersvm import *

~\anaconda3\envs\gpu_p36\lib\site-packages\thundersvm\thundersvm.py in <module>
     50         thundersvm = CDLL(lib_path)
     51     else:
---> 52         raise FileNotFoundError("Please build the library first!")
     53 SVM_TYPE = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr']
     54 KERNEL_TYPE = ['linear', 'polynomial', 'rbf', 'sigmoid', 'precomputed']

FileNotFoundError: Please build the library first!

Do I have to put the thundersvm folder into my environment folder "gpu_p36"? I installed thundersvm under "C:\Users\name\thundersvm". Or do I have to install thundersvm in my environment separately?

I would be so thankful if someone can help me with that issue!

Thank you!

Best regards, Daniel

QinbinLi commented 3 years ago

Hi @StartingProgramming ,

Did you install the python interface here (https://github.com/Xtra-Computing/thundersvm/tree/master/python)? You can try from thundersvm import * in Python and see whether it works. If it does not work, then you may not correctly install the python interface.