0

我正在尝试从 libSVM 运行plotroc.py但我弹出了一些错误消息,我编译了库,所以我确实拥有它并且对它的调用是正确的

 Traceback (most recent call last):
  File "plotroc.py", line 3, in <module>
    from svmutil import *
  File "libsvm-master/python/svmutil.py", line 5, in <module>
    from svm import *
  File "libsvm-master/python/svm.py", line 303, in <module>
    fillprototype(libsvm.svm_get_sv_indices, None, [POINTER(svm_model), POINTER(c_int)])
  File "/opt/python-2.7/lib/python2.7/ctypes/__init__.py", line 366, in __getattr__
    func = self.__getitem__(name)
  File "/opt/python-2.7/lib/python2.7/ctypes/__init__.py", line 371, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: libsvm-master/python/../libsvm.so.2: undefined symbol: svm_get_sv_indices

你能指出问题的根源吗?

4

1 回答 1

0

仅适用于 linux 系统:

下载 libsvm.zip 包。解压后找到名为“python”的目录。此目录必须包含 svmutil.py、Makefile、svm.py 等文件

运行“make”命令..

将您的 plotroc.py 脚本粘贴到该目录中

./plotroc.py

于 2014-01-14T09:55:56.500 回答