简体   繁体   English

我该如何解决“使用vertcat内存不足时出错”?

[英]How can i solve “Error using vertcat Out of memory”?

My code reads 7 folders of images and extract features in 7 matrices and collect all 7 matrices in one big matrix by using "vertcat", In total I have a matrix which contains features of 1745 Images and i want to classify them using Multi-SVM classifier. 我的代码读取7个图像文件夹并提取7个矩阵中的特征,并使用“ vertcat”将所有7个矩阵收集在一个大矩阵中。我总共有一个包含1745个图像特征的矩阵,我想使用Multi-SVM对它们进行分类分类器。 This is the Error: 这是错误:

Error using vertcat Out of memory. 使用vertcat时发生错误内存不足。 Type HELP MEMORY for your options. 输入HELP MEMORY作为您的选项。

How i can solve this problem? 我该如何解决这个问题? please. 请。

  • My OS is Windows 7 64Bit 我的操作系统是Windows 7 64Bit
  • 4 GB RAM 4 GB内存
  • Matlab 2016a 64Bit Matlab 2016a 64位

Unfortunately, MATLAB is actually running out of memory when it attempts to concatenate your matrices. 不幸的是,当MATLAB试图连接矩阵时,实际上实际上是内存不足。 There are certain memory tricks you can do to try to make this process go smoother (kill certain programs before starting matlab). 您可以采取某些内存技巧来尝试使此过程更流畅(在启动matlab之前先杀死某些程序)。 Ideally you would want as little as possible running while you are trying this operation. 理想情况下,尝试此操作时,您希望运行的次数尽可能少。

When you run memory you can see a list of items 运行memory您可以看到项目列表

 >> memory
    Maximum possible array:               4577 MB (4.800e+009 bytes) *
    Memory available for all arrays:      4577 MB (4.800e+009 bytes) *
    Memory used by MATLAB:                 330 MB (3.458e+008 bytes)
    Physical Memory (RAM):                3503 MB (3.674e+009 bytes)

    *  Limited by System Memory (physical + swap file) available.

What you are probably running into is your MATLAB max possible array size isn't large enough for your array. 您可能遇到的问题是MATLAB的最大可能数组大小不足以容纳您的数组。 You can try to optimize your code a bit to free up individual arrays after you concatenate them, but most likely your only options are to buy more RAM or use a smaller array. 您可以尝试对代码进行一些优化,以在连接各个阵列后释放它们,但是最有可能的唯一选择是购买更多的RAM或使用较小的阵列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM