matlab matconvnet

来源:互联网 发布:白金数据 东野圭吾 编辑:程序博客网 时间:2024/05/25 21:34

我家里的电脑是win10,装了matlab2013a和visual studio2013.自己的笔记本是win7,装的是matlab7和vs2010,还有vc6.0.毕设需要用到matconvnet,需要在matlab中用C编译器。输入mex -setup进行配置。而不用版本的matlab支持的编译器也不同,支持的操作系统也不同。用笔记本的matlab7可以使用vc6.0编译器,但是运行matconvnet会出错,果然是太老了。430行[~,~,ext] = fileparts(srcs{i}) ; ext(1) = [] ;这一句出错,貌似是不支持语法吧。家里的电脑找不到合适的编译器,先是按照错误提示安装sdk for win7 and .net4.0。由于电脑上的.net framework是4.5的必须先卸载然后再装,可是又卸不掉。然后尝试用vs2012.安装了以后显示

*****************************************************************************
  Error: Microsoft Visual C++ 2012 requires the Microsoft Windows Software 
         Development Kit (SDK), but the SDK cannot be found.  Examine your  
         Microsoft Visual C++ 2012 installation.
*****************************************************************************

又安装了sdk可是还是出现同样的错误,后来重新安装一次vs就好了,出现warning

**************************************************************************
  Warning: The MATLAB C and Fortran API has changed to support MATLAB
           variables with more than 2^32-1 elements.  In the near future
           you will be required to update your code to utilize the new
           API. You can find more information about this at:
           http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html 
           Building with the -largeArrayDims option enables the new API.
**************************************************************************

输入 run matlab/vl_compilenn后还是出现错误

Error using mex (line 206)
Unable to complete successfully.

Error in vl_compilenn>mex_compile (line 478)
mex(mopts{:}) ;

Error in vl_compilenn (line 439)
    mex_compile(opts, srcs{i}, objfile, flags.mexcc) ;

Error in run (line 64)
evalin('caller', [script ';']);
然后加入verbose命令获取更多信息vl_compilenn('verbose', 1)
发现是因为: Error: Unrecognized switch: -cxx
mex的-cxx命令是在unix下面用的,这个问题stackoverflow上有人问过。
所以我就把vl_compilenn里面的所有-cxx命令都注释掉,然后问题就解决了。
运行了一会,打出了一大串,有warning:\matconvnet-1.0-beta18\matlab\src\bits\datamex.cu(444) : warning C4244: “=”: 从“size_t”转换到“double”,可能丢失数据
貌似是编译了好几个文件,然后就没问题了

0 0