How to modify easy.py in libsvm-3.18 to solve erro

2020-08-04 06:59发布

问题:

While using easy.py script it generates error as shown in figure:

Path for gnuplot is set well. There is no problem in using grid.py

Some people suggested (http://www.cnblogs.com/tekson/archive/2009/05/25/1489222.html) to change following line in easy.py:

cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)

But no idea how to modify above code line to resolve the problem.

If anyone have got same problem and solved this, please let me know. Thanks in advance.

回答1:

Finally I found the solution. I think it will be helpful for those who are facing same problem.

Thanks to: http://huangbo929.blog.edu.cn/home.php?mod=space&uid=294073&do=blog&id=70541

Solution:

Replace Line

"cmd = '{0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)"

With

cmd = 'python {0} -svmtrain "{1}" -gnuplot "{2}" "{3}"'.format(grid_py, svmtrain_exe, gnuplot_exe, scaled_file)



标签: libsvm