shogun-toolbox的使用方法和问题总结
来源:互联网 发布:java笔试题及答案 编辑:程序博客网 时间:2024/06/03 11:34
本以为在上一次安装入坑之后能顺利使用,没想到在matlab接口具体使用时又出现了问题,接下来我将一一进行说明.
上一篇shogun-toolbox的安装与问题总结
1. matlab接口示例代码生成
这块内容一定是shogun的新手遇到的头疼的问题,找不到切入点,没办法模仿示例代码进行改写.一开始我也是摸不着头脑,后来就看shogun包中的doc/cookbook,但发现里面压根没有关于matlab的示例.所有又在包中到处寻找,直到看到了example/README.md和example/generate_documented.sh文件才算找到了希望.
$ cd shogun/examples$ ./generate_documented.sh
生成示例代码,我们可以在examples/documented/matlab_static下看到示例代码.
2. matlab示例代码执行问题处理
在matlab中执行示例代码时,遇到了如下错误:
>> svr_regressionInvalid MEX-file '/home/slave/kernel/shogun410/build/src/interfaces/matlab_static/sg.mexa64':libshogun.so.17: cannot open shared object file: No such file or directoryError in svr_regression (line 6)sg('set_features', 'TRAIN', traindat);
matlab
无法找到libshogun.so.17
文件. 在github上找到了相关的问题https://github.com/shogun-toolbox/shogun/issues/2344,shogun的维护者说是没有配置LD_LIBRARY_PATH
变量导致的(其实这个问题在安装教程里就提到过https://github.com/shogun-toolbox/shogun/wiki/INSTALL#general,只是我当时没有注意).
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:path_to_shogun/src/shogun/
然后,再次执行示例代码,这次又出现了新的问题.
>> svr_regressionInvalid MEX-file '/home/slave/kernel/shogun410/build/src/interfaces/matlab_static/sg.mexa64':/usr/local/MATLAB/R2012b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' notfound (required by /usr/local/lib/libshogun.so.17)Error in svr_regression (line 6)sg('set_features', 'TRAIN', traindat);
这次又是与libstdc++.so.6
相关的问题,在网上搜索了相关的解决方案,最终解决.
首先,我们需要定位系统中的libstdc++.so.6
所在位置 ,然后我们将该位置的libstdc++.so.6
文件链接到matlab中.
$ locate libstdc++.so.6/home/slave/Downloads/matlab/bin/glnxa64/libstdc++.so.6/home/slave/Downloads/matlab/bin/glnxa64/libstdc++.so.6.0.13/usr/lib/x86_64-linux-gnu/libstdc++.so.6/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6.0.13/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6.0.13/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py
我们可以发现系统中的libstdc++.so.6
文件路径在/usr/lib/x86_64-linux-gnu/libstdc++.so.6
.将matlab中的文件备份,做链接.
$ sudo mv /usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6 /usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6.bak$ sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6
然后,重新启动matlab运行svr_regression
示例代码.得到一下信息,并绘制出图像.OK,大功告成.
libshogun (x86_64/v4.1.0_2016-2-10_18:33262400)Copyright (C) 1999-2009 Fraunhofer Institute FIRSTCopyright (C) 1999-2011 Max Planck SocietyCopyright (C) 2009-2011 Berlin Institute of TechnologyCopyright (C) 2012-2014 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann, Viktor Gal, Fernando Iglesias et alWritten (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al.( configure options: "TODO" compile flags: "-Wall -Wno-unused-parameter -Wformat -Wformat-security -Wparentheses -Wshadow -Wno-unknown-pragmas -Wno-deprecated -fopenmp -O3 -fexpensive-optimizations -frerun-cse-after-loop -fcse-follow-jumps -finline-functions -fschedule-insns2 -fthread-jumps -fforce-addr -fstrength-reduce -funroll-loops -mfpmath=sse" link flags: "-lpthread" )( seeding random number generator with 0 (seed size 256))determined range for x in log(1+exp(-x)) is:37 )
其实,我在github上都提问了https://github.com/shogun-toolbox/shogun/issues/3453,但是自己解决掉了问题,属于自问自答型.
参考:
- https://github.com/shogun-toolbox/shogun/wiki/INSTALL
- https://github.com/shogun-toolbox/shogun/issues/2344
- http://blog.csdn.net/woyaopojie1990/article/details/28426013
- https://github.com/shogun-toolbox/shogun/issues/3453
- shogun-toolbox的使用方法和问题总结
- shogun-toolbox的安装与问题总结
- SHOGUN toolbox的一些使用心得
- [Shogun] A large scale machine learning toolbox
- matlab工具箱下载安装和使用方法的汇总|Toolbox 大全
- Winpcap的安装使用方法和问题总结
- matlab calibration toolbox -- matlab标定工具的使用方法--去畸变和双目校正
- matlab calibration toolbox -- matlab标定工具的使用方法--去畸变和双目校正
- matlab calibration toolbox -- matlab标定工具的使用方法--去畸变和双目校正
- matlab calibration toolbox -- matlab标定工具的使用方法--去畸变和双目校正
- matlab calibration toolbox -- matlab标定工具的使用方法--去畸变和双目校正
- velocity的toolbox使用方法(含与struts2的集成)
- 信号处理和模式识别方面的 toolbox
- 总结安装cocoapods的步骤和使用方法
- svn使用方法和出现的一些问题
- C#自定义控件 在 Toolbox显示不了的问题
- Visual Studio 2008 Toolbox里控件消失(#13119)的问题
- Visual Studio 2008 Toolbox里控件消失(#13119)的问题
- HQL常用语句
- AndroidStudio常用快捷键
- MongooDB(三)---操作
- linux定时备份mysql并同步到其它服务器
- oracle创建表空间、用户及授权
- shogun-toolbox的使用方法和问题总结
- Java HTTP中GET与POST的区别
- 更改Anaconda下载源,提高下载速度
- iOS app性能优化的那些事(二)
- sql语句查询,多字段like模糊查询优化
- 什么是gradle
- 重新创建Activity
- Bayesian Browsing Model 的个人理解
- 配置与使用PXE自动化部署CentOS7