如何在libsvm-3.18中修改easy.py以解决错误"Trackback<最近调用过一次":文件"easy.py",第6行---- [英] How to modify easy.py in libsvm-3.18 to solve error "Trackback <most recent call last>: File "easy.py", line 6----

查看:89
本文介绍了如何在libsvm-3.18中修改easy.py以解决错误"Trackback<最近调用过一次":文件"easy.py",第6行----的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用easy.py脚本时,它会产生错误,如图所示:

gnuplot的路径设置正确.使用grid.py

没问题

有人建议( http://www.cnblogs .com/tekson/archive/2009/05/25/1489222.html )更改easy.py中的以下行:

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

但是不知道如何修改以上代码行来解决该问题.

如果有人遇到相同的问题并解决了该问题,请告诉我. 预先感谢.

解决方案

终于找到了解决方案.我认为这将对那些面临相同问题的人有所帮助.

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

解决方案:

替换行

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

使用

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

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.

解决方案

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-3.18中修改easy.py以解决错误"Trackback<最近调用过一次":文件"easy.py",第6行----的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆