Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python libsvm的grid.py的输出错误_Python_Machine Learning_Svm_Libsvm - Fatal编程技术网

Python libsvm的grid.py的输出错误

Python libsvm的grid.py的输出错误,python,machine-learning,svm,libsvm,Python,Machine Learning,Svm,Libsvm,我刚刚使用libsvm的演示数据heart_scale来测试grid.py,但不幸的是,它总是输出相同的错误,如下所示: Traceback (most recent call last): File "grid.py", line 266, in run if rate is None: raise RuntimeError('get no rate') RuntimeError: get no rate worker local quit. 我尝试过使用不同版本的libsvm和gnupl

我刚刚使用libsvm的演示数据heart_scale来测试grid.py,但不幸的是,它总是输出相同的错误,如下所示:

Traceback (most recent call last):
File "grid.py", line 266, in run
if rate is None: raise RuntimeError('get no rate')
RuntimeError: get no rate
worker local quit.

我尝试过使用不同版本的libsvm和gnuplot,但遇到了相同的错误

Versions of libsvms' are : 3.17 and 3.21 
Versions of gnuplots' are : 4.2.6 and 5.0.3
Version of Python : 2.7
另外,我已经修改了grid.py中的目录

self.svmtrain_pathname = os.path.join(dirname, r'F:\tools\libsvm-master\windows\svm-train.exe')

我在其他问题中读到了一些答案,但仍然没有用。 链接:


有人能帮我找出解决这个问题的方法吗。非常感谢。

我也遇到了同样的问题,我很容易找到原因。希望对你有帮助

尝试直接使用svm训练,如
svm train my_data.txt
,并检查它是否处理

我执行了这个命令,发现我的输入文件(my_data.txt)是错误的。输出提示我输入文件的错误行。我修改了它,然后它工作了


如果它不起作用,请评论我或参考类似的答案,如

实际上,我使用了不同版本的libsvm和gnuplots,它们发现gnuplots的版本太新了,所以使用旧版本最终可以解决问题

self.gnuplot_pathname = r'C:\gnuplot\bin\gnuplot.exe'