windows 如何在窗口中运行 libsvm 的 easy.py?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7266214/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:58:25  来源:igfitidea点击:

How to run easy.py of libsvm in window?

windowssvmlibsvm

提问by Cassie

I am new to the libsvm and sorry for some silly questions. I am trying to run easy.py but have problems to do so. I have

我是 libsvm 的新手,对于一些愚蠢的问题很抱歉。我正在尝试运行 easy.py,但这样做有问题。我有

  1. downloaded the libsvm-3.1 package and extract it into C:\User\Cassie\libsvm
  2. Install Python and it created a folder at C:/Python27
  3. Download gp443win32.zipand extract it to a folder gnuplot at Download folder. Make a copy of gnuplot.exeand paste it to C:\User\Cassie\libsvm3-1\libsvm3-1\tools
  4. invoke cmd at Window 7 and typed "easy.py myfile.txt". But an error message showed
  1. 下载 libsvm-3.1 包并解压到C:\User\Cassie\libsvm
  2. 安装 Python 并在C:/Python27创建一个文件夹
  3. 下载gp443win32.zip并将其压缩到下载文件夹中的 gnuplot 文件夹中。复制gnuplot.exe并将其粘贴到C:\User\Cassie\libsvm3-1\libsvm3-1\tools
  4. 在 Window 7 中调用 cmd 并输入“easy.py myfile.txt”。但是错误信息显示

"Traceback (most recent call last): File "C:\User\Cassie\libsvm-3.1\libsvm-3.1\tools\easy.py", line 31, in assert os.path.exists(gnuplot_exe),"gnuplot executable not found" AssertionError: gnuplot executable not found"

“回溯(最近一次调用最后一次):文件“C:\User\Cassie\libsvm-3.1\libsvm-3.1\tools\easy.py”,第 31 行,在 assert os.path.exists(gnuplot_exe) 中,“gnuplot 可执行文件未找到“断言错误:未找到 gnuplot 可执行文件”

Questions:

问题:

  1. Did I install the wrong gnuplot package?
  2. Did I move the wrong application ? gnuplot.exe
  3. Did I need to configure some path or envinroment to make the cmd find gnuplot.exe?
  4. Did I type the wrong command to make easy.pyrun ?
  5. Do I have to label the training file first ?
  1. 我是否安装了错误的 gnuplot 包?
  2. 我移动了错误的应用程序吗?程序图
  3. 我是否需要配置一些路径或环境才能让 cmd 找到gnuplot.exe
  4. 我是否输入了错误的命令来运行easy.py
  5. 我必须先标记训练文件吗?

There are much information at libsvm and I was really confused. Any experience with this issue is welcome. Thank you all very much,

libsvm 上有很多信息,我真的很困惑。欢迎任何有关此问题的经验。非常感谢大家,

回答by machine_learning

It looks like a "path problem". So open easy.py in text editor and go the line 25 which will look something like "gnuplot_exe = r"c:\tmp\Desktop\gnuplot\bin\pgnuplot.exe".

它看起来像一个“路径问题”。所以在文本编辑器中打开easy.py并转到第25行,它看起来像“gnuplot_exe = r”c:\tmp\Desktop\gnuplot\bin\pgnuplot.exe”。

so you need to put the exact path of gnuplot stored , for example for me it was "gnuplot_exe = r"c:\Documents and Settings\Desktop\gnuplot\binary\pgnuplot.exe".

所以你需要输入 gnuplot 存储的确切路径,例如对我来说它是“gnuplot_exe = r”c:\Documents and Settings\Desktop\gnuplot\binary\pgnuplot.exe”。

I Hope this will help you!!!

我希望这能帮到您!!!

回答by Wisdom

  1. Please check your path of gnuplot.exe, check every character;
  2. Please install other version of gnuplot, maybe the version of gnuplot is incompatible whih the current version of libSVM;
  3. In my computer, LibSVM 3.2.1 gnuplot 5.0.1 python 2.7. It is OK!
  1. 请检查您的 gnuplot.exe 路径,检查每个字符;
  2. 请安装其他版本的 gnuplot,可能是 gnuplot 的版本与当前版本的 libSVM 不兼容;
  3. 在我的电脑中,LibSVM 3.2.1 gnuplot 5.0.1 python 2.7。没关系!