python-2.7 - Python 中的 libsvm : getting error

标签 python-2.7 svm libsvm

我是 Python 新手。我想在我的项目中使用 svm。我使用的是 libsvm 3.12,但是当我这样做时..

from svm import * 

然后我收到以下错误:

Traceback (most recent call last):

  File "C:/Python27/main.py", line 31, in 
    from svm import *
  File "C:/Python27\svm.py", line 12, in 
    libsvm = CDLL(find_library('libsvm'))
  File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)

WindowsError: [Error 193] %1 is not a valid Win32 application

我应该做什么?

libsvm README 文件建议我将 libsvm.dll 复制到 system32 文件夹中,我这样做了..但我仍然收到错误。我正在使用 64 位 Python。也许这就是导致问题的原因?

最佳答案

我也遇到了同样的问题。

正如 Velociraptors 在 VLC Python Bindings -- Error 193 中发布的那样:

I'm going to guess that the problem is trying to load a 32-bit DLL from a 64-bit process. You may be able to fix it by using a 32-bit Python build.

我们通过从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#libsvm 下载 python 的 libSVM 解决了这个问题

关于python-2.7 - Python 中的 libsvm : getting error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10634569/

相关文章:

OpenCV:如何将 HOGDescriptor::detectMultiScale() 与自定义 SVM 一起使用?

machine-learning - 为 libsvm-线性 内核选择优化参数

python - 在给定的时间和分钟使用 crontab 时,周期性任务不起作用

python-2.7 - PyMC 中的逻辑回归

r - R中的svm,训练数据集

scikit-learn - 分类 - 修改后的 huber 损失 : how is it more tolerant to outliers?

machine-learning - libsvm 返回一个简单的解决方案

python - 使用 python 的 libsvm 支持具有高维输出的向量回归

python 内存使用 : txt file much smaller than python list containing file text

python - 查找数据框中每一行的前 N ​​列